mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add person detection improvement: inversion firstName<->lastName
This commit is contained in:
parent
90f579d88a
commit
d70be5ea85
@ -302,7 +302,9 @@ class PersonController extends Controller
|
||||
|
||||
$dql = 'SELECT p from ChillPersonBundle:Person p WHERE '
|
||||
. 'LOWER(p.firstName) LIKE LOWER(:firstName)'
|
||||
. ' OR LOWER(p.lastName) LIKE LOWER(:lastName)';
|
||||
. ' OR LOWER(p.lastName) LIKE LOWER(:lastName)'
|
||||
. ' OR LOWER(p.firstName) LIKE LOWER(:lastName)'
|
||||
. ' OR LOWER(p.lastName) LIKE LOWER(:firstName)';
|
||||
|
||||
$query->setParameter('firstName', $form['firstName']->getData())
|
||||
->setParameter('lastName', $form['lastName']->getData());
|
||||
|
@ -240,6 +240,31 @@ class PersonControllerCreateTest extends WebTestCase
|
||||
|
||||
}
|
||||
|
||||
public function testReviewExistingDetectionInversedLastNameWithFirstName()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
|
||||
$crawler = $client->request('GET', '/fr/person/new');
|
||||
|
||||
//test the page is loaded before continuing
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$form = $crawler->selectButton("Ajouter la personne")->form();
|
||||
$form = $this->fillAValidCreationForm($form, 'Charline', 'dd');
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertContains('Depardieu', $client->getCrawler()->text(),
|
||||
"check that the page has detected the lastname of a person existing in database");
|
||||
|
||||
//inversion
|
||||
$form = $crawler->selectButton("Ajouter la personne")->form();
|
||||
$form = $this->fillAValidCreationForm($form, 'dd', 'Charline');
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertContains('Depardieu', $client->getCrawler()->text(),
|
||||
"check that the page has detected the lastname of a person existing in database");
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
static::bootKernel();
|
||||
|
Loading…
x
Reference in New Issue
Block a user