mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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'
|
'q' => '@person Depardieu'
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testExpectedNamed()
|
public function testExpectedNamed()
|
||||||
@ -49,82 +49,82 @@ class PersonSearchTest extends WebTestCase
|
|||||||
'q' => '@person Depardieu', 'name' => 'person_regular'
|
'q' => '@person Depardieu', 'name' => 'person_regular'
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByLastName()
|
public function testSearchByLastName()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu');
|
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByFirstNameLower()
|
public function testSearchByFirstNameLower()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Gérard');
|
$crawler = $this->generateCrawlerForSearch('@person firstname:Gérard');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByFirstNamePartim()
|
public function testSearchByFirstNamePartim()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Ger');
|
$crawler = $this->generateCrawlerForSearch('@person firstname:Ger');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLastNameAccentued()
|
public function testLastNameAccentued()
|
||||||
{
|
{
|
||||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person lastname:manço');
|
$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');
|
$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()
|
public function testSearchByFirstName()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person firstname:Jean');
|
$crawler = $this->generateCrawlerForSearch('@person firstname:Jean');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByFirstNameLower2()
|
public function testSearchByFirstNameLower2()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person firstname:jean');
|
$crawler = $this->generateCrawlerForSearch('@person firstname:jean');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByFirstNamePartim2()
|
public function testSearchByFirstNamePartim2()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person firstname:ean');
|
$crawler = $this->generateCrawlerForSearch('@person firstname:ean');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->text());
|
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchByFirstNameAccented()
|
public function testSearchByFirstNameAccented()
|
||||||
{
|
{
|
||||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person firstname:Gérard');
|
$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');
|
$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()
|
public function testSearchCombineLastnameAndNationality()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu nationality:RU');
|
$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
|
//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");
|
"assert clause firstname and nationality are AND");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,9 +132,9 @@ class PersonSearchTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu firstname:Jean');
|
$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
|
//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");
|
"assert clause firstname and nationality are AND");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,54 +142,54 @@ class PersonSearchTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27');
|
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27');
|
||||||
|
|
||||||
$this->assertRegExp('/Gérard/', $crawler->text());
|
$this->assertRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertRegExp('/Bart/', $crawler->text());
|
$this->assertRegExp('/Bart/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchCombineBirthdateAndLastName()
|
public function testSearchCombineBirthdateAndLastName()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27 lastname:(Van Snick)');
|
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27 lastname:(Van Snick)');
|
||||||
|
|
||||||
$this->assertRegExp('/Bart/', $crawler->text());
|
$this->assertRegExp('/Bart/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Depardieu/', $crawler->text());
|
$this->assertNotRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchCombineGenderAndLastName()
|
public function testSearchCombineGenderAndLastName()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)');
|
$crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)');
|
||||||
|
|
||||||
$this->assertRegExp('/Charline/', $crawler->text());
|
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Gérard/', $crawler->text());
|
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchMultipleTrigramUseAndClauseInDefault()
|
public function testSearchMultipleTrigramUseAndClauseInDefault()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person cha dep');
|
$crawler = $this->generateCrawlerForSearch('@person cha dep');
|
||||||
|
|
||||||
$this->assertRegExp('/Charline/', $crawler->text());
|
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Gérard/', $crawler->text());
|
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Jean/', $crawler->text());
|
$this->assertNotRegExp('/Jean/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDefaultAccented()
|
public function testDefaultAccented()
|
||||||
{
|
{
|
||||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person manço');
|
$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');
|
$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');
|
$crawlerSpecial = $this->generateCrawlerForSearch('@person Étienne');
|
||||||
|
|
||||||
$this->assertRegExp('/Étienne/', $crawlerSpecial->text());
|
$this->assertRegExp('/Étienne/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||||
|
|
||||||
|
|
||||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person etienne');
|
$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