calls++; return '{"requests":0}'; } } it('caches identical requests within the TTL', function () { Cache::flush(); $team = Team::factory()->create(); $server = Server::factory()->create(['team_id' => $team->id]); $client = new CountingTrafficClient($server); $client->overview('app', 'a', 'b'); $client->overview('app', 'a', 'b'); expect($client->calls)->toBe(1); });