A contract test for the API you depend on

Mocking an upstream service makes the suite fast and guarantees nothing about the upstream still behaving that way. A contract test is a small suite that runs against the real thing, on a schedule rather than on every commit.

/**
 * @group contract
 */
public function testStockEndpointStillReturnsWhatWeAssume()
{
    $body = json_decode((string) $this->realClient->get('/inv?sku=FR-100')->getBody(), true);

    $this->assertArrayHasKey('qty_avail', $body);
    $this->assertIsInt($body['qty_avail']);
}

It asserts only the fields you depend on, which keeps it stable when the provider adds things. Running it nightly rather than per commit is the point — a failure means the upstream changed, which is news rather than a broken build. Without it, that news arrives as a production incident on the day they deploy.