client->request('GET', '/api/food_orders'); $this->assertResponseIsSuccessful(); $this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8'); $this->assertJsonContains([ '@context' => '/api/contexts/FoodOrder', '@id' => '/api/food_orders', '@type' => 'Collection', 'totalItems' => 1, ]); $array = $response->toArray(); expect($array['member'][0]['orderItems'])->toHaveCount(10); });