loginAs($this->user); // $this->client->request('GET', '/api/residence_areas'); // $this->assertResponseIsSuccessful(); // $this->assertMatchesResourceCollectionJsonSchema(ResidenceArea::class); if($this->user->getPerson()) { $this->get('/api/residence_areas'); $this->validateCollectionSchema(ResidenceArea::class); $this->assertJsonContains([ '@context' => '/api/contexts/ResidenceArea', '@id' => '/api/residence_areas', '@type' => 'hydra:Collection', 'hydra:totalItems' => 1, 'hydra:member' => [ ["label" => "My Residence Area"] ], ]); } } }