signin(); $response = $this->json('GET', '/api/countries'); $response->assertStatus(200); $response->assertJsonStructure([ 'data' => ['*' => $this->jsonCountries], ]); $response->assertJsonFragment([ 'DEU' => [ 'id' => 'DE', 'iso' => 'DE', 'name' => 'Germany', 'object' => 'country', ], ]); } /** @test */ public function it_gets_a_specific_country_in_a_specific_country() { $user = $this->signin(); $user->locale = 'fr'; $user->save(); $response = $this->json('GET', '/api/countries'); $response->assertStatus(200); $response->assertJsonStructure([ 'data' => ['*' => $this->jsonCountries], ]); $response->assertJsonFragment([ 'DEU' => [ 'id' => 'DE', 'iso' => 'DE', 'name' => 'Allemagne', 'object' => 'country', ], ]); } }