mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Add address suggestion for a person
This commit is contained in:
@@ -45,6 +45,31 @@ class PersonApiControllerTest extends WebTestCase
|
||||
$this->assertEquals($personId, $data['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataGetPersonFromCenterA
|
||||
*/
|
||||
public function testPersonAddressSuggestion($personId): void
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(Request::METHOD_GET, "/api/1.0/person/address/suggest/by-person/{$personId}.json");
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataGetPersonFromCenterB
|
||||
*/
|
||||
public function testPersonAddressSuggestionUnauthorized($personId): void
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(Request::METHOD_GET, "/api/1.0/person/address/suggest/by-person/{$personId}.json");
|
||||
$response = $client->getResponse();
|
||||
|
||||
$this->assertEquals(403, $response->getStatusCode());
|
||||
}
|
||||
|
||||
public function dataGetPersonFromCenterA(): \Iterator
|
||||
{
|
||||
self::bootKernel();
|
||||
@@ -61,6 +86,8 @@ class PersonApiControllerTest extends WebTestCase
|
||||
|
||||
yield \array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
yield \array_pop($personIds);
|
||||
}
|
||||
|
||||
public function dataGetPersonFromCenterB(): \Iterator
|
||||
|
Reference in New Issue
Block a user