mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix test PersonSearch by adding html node filtering
This commit is contained in:
parent
a0ff6bbe03
commit
736b2255ab
@ -38,7 +38,7 @@ class PersonSearchTest extends WebTestCase
|
||||
'q' => '@person Depardieu'
|
||||
));
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testExpectedNamed()
|
||||
@ -49,82 +49,82 @@ class PersonSearchTest extends WebTestCase
|
||||
'q' => '@person Depardieu', 'name' => 'person_regular'
|
||||
));
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByLastName()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstNameLower()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Gérard');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstNamePartim()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Ger');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testLastNameAccentued()
|
||||
{
|
||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person lastname:manço');
|
||||
|
||||
$this->assertRegExp('/Manço/', $crawlerSpecial->text());
|
||||
$this->assertRegExp('/Manço/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||
|
||||
|
||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person lastname:manco');
|
||||
|
||||
$this->assertRegExp('/Manço/', $crawlerNoSpecial->text());
|
||||
$this->assertRegExp('/Manço/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstName()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Jean');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstNameLower2()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person firstname:jean');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstNamePartim2()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person firstname:ean');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchByFirstNameAccented()
|
||||
{
|
||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person firstname:Gérard');
|
||||
|
||||
$this->assertRegExp('/Gérard/', $crawlerSpecial->text());
|
||||
$this->assertRegExp('/Gérard/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||
|
||||
|
||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person firstname:Gerard');
|
||||
|
||||
$this->assertRegExp('/Gérard/', $crawlerNoSpecial->text());
|
||||
$this->assertRegExp('/Gérard/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchCombineLastnameAndNationality()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu nationality:RU');
|
||||
|
||||
$this->assertRegExp('/Gérard/', $crawler->text());
|
||||
$this->assertRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||
//if this is a AND clause, Jean Depardieu should not appears
|
||||
$this->assertNotRegExp('/Jean/', $crawler->text(),
|
||||
$this->assertNotRegExp('/Jean/', $crawler->filter('.list-with-period')->text(),
|
||||
"assert clause firstname and nationality are AND");
|
||||
}
|
||||
|
||||
@ -132,9 +132,9 @@ class PersonSearchTest extends WebTestCase
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu firstname:Jean');
|
||||
|
||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
//if this is a AND clause, Jean Depardieu should not appears
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->text(),
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text(),
|
||||
"assert clause firstname and nationality are AND");
|
||||
}
|
||||
|
||||
@ -142,54 +142,54 @@ class PersonSearchTest extends WebTestCase
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27');
|
||||
|
||||
$this->assertRegExp('/Gérard/', $crawler->text());
|
||||
$this->assertRegExp('/Bart/', $crawler->text());
|
||||
$this->assertRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||
$this->assertRegExp('/Bart/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchCombineBirthdateAndLastName()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27 lastname:(Van Snick)');
|
||||
|
||||
$this->assertRegExp('/Bart/', $crawler->text());
|
||||
$this->assertNotRegExp('/Depardieu/', $crawler->text());
|
||||
$this->assertRegExp('/Bart/', $crawler->filter('.list-with-period')->text());
|
||||
$this->assertNotRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchCombineGenderAndLastName()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)');
|
||||
|
||||
$this->assertRegExp('/Charline/', $crawler->text());
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->text());
|
||||
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testSearchMultipleTrigramUseAndClauseInDefault()
|
||||
{
|
||||
$crawler = $this->generateCrawlerForSearch('@person cha dep');
|
||||
|
||||
$this->assertRegExp('/Charline/', $crawler->text());
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->text());
|
||||
$this->assertNotRegExp('/Jean/', $crawler->text());
|
||||
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||
$this->assertNotRegExp('/Jean/', $crawler->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
public function testDefaultAccented()
|
||||
{
|
||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person manço');
|
||||
|
||||
$this->assertRegExp('/Manço/', $crawlerSpecial->text());
|
||||
$this->assertRegExp('/Manço/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||
|
||||
|
||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person manco');
|
||||
|
||||
$this->assertRegExp('/Manço/', $crawlerNoSpecial->text());
|
||||
$this->assertRegExp('/Manço/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||
|
||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person Étienne');
|
||||
|
||||
$this->assertRegExp('/Étienne/', $crawlerSpecial->text());
|
||||
$this->assertRegExp('/Étienne/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||
|
||||
|
||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person etienne');
|
||||
|
||||
$this->assertRegExp('/Étienne/', $crawlerNoSpecial->text());
|
||||
$this->assertRegExp('/Étienne/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user