getClientAuthenticated(); $client->request( 'GET', '/api/1.0/main/postal-code/search.json', ['q' => 'fontenay le comte'] ); $this->assertResponseIsSuccessful(); $data = json_decode($client->getResponse()->getContent(), true); $this->assertEquals('Fontenay Le Comte', $data['results'][0]['name']); // test response with invalid search pattern $client->request( 'GET', '/api/1.0/main/postal-code/search.json', ['q' => ''] ); $this->assertResponseStatusCodeSame(400); } }