mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
tests: Get rid of PHPUnit deprecations.
This commit is contained in:
parent
6ebcd87508
commit
e2ad590310
@ -66,7 +66,7 @@ final class ActivityReasonCategoryControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class ActivityReasonControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class ActivityTypeControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -61,7 +61,7 @@ final class CustomFieldControllerTest_TODO extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class EventControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class EventTypeControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class RoleControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ final class StatusControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -72,6 +72,6 @@ final class CenterControllerTest extends WebTestCase
|
|||||||
$crawler = $client->request('GET', '/fr/admin/center/');
|
$crawler = $client->request('GET', '/fr/admin/center/');
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertMatchesRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ final class LoginControllerTest extends WebTestCase
|
|||||||
$this->assertTrue($client->getResponse()->isRedirect());
|
$this->assertTrue($client->getResponse()->isRedirect());
|
||||||
|
|
||||||
//the response is not a login page, but on a new page
|
//the response is not a login page, but on a new page
|
||||||
$this->assertNotRegExp('/\/login$/', $client->getResponse()
|
$this->assertDoesNotMatchRegularExpression('/\/login$/', $client->getResponse()
|
||||||
->headers
|
->headers
|
||||||
->get('location'));
|
->get('location'));
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ final class LoginControllerTest extends WebTestCase
|
|||||||
$client->followRedirects(true);
|
$client->followRedirects(true);
|
||||||
$crawler = $client->request('GET', '/');
|
$crawler = $client->request('GET', '/');
|
||||||
|
|
||||||
$this->assertRegExp('/center a_social/', $client->getResponse()
|
$this->assertMatchesRegularExpression('/center a_social/', $client->getResponse()
|
||||||
->getContent());
|
->getContent());
|
||||||
$logoutLinkFilter = $crawler->filter('a:contains("Se déconnecter")');
|
$logoutLinkFilter = $crawler->filter('a:contains("Se déconnecter")');
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ final class LoginControllerTest extends WebTestCase
|
|||||||
$client->followRedirect(); //redirect to login page
|
$client->followRedirect(); //redirect to login page
|
||||||
|
|
||||||
//check we are back on login page
|
//check we are back on login page
|
||||||
$this->assertRegExp('/\/login$/', $client->getResponse()
|
$this->assertMatchesRegularExpression('/\/login$/', $client->getResponse()
|
||||||
->headers
|
->headers
|
||||||
->get('location'));
|
->get('location'));
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ final class PermissionsGroupControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -50,8 +50,6 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase
|
|||||||
|
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::$kernel->getContainer()->get('doctrine.orm.entity_manager');
|
$em = self::$kernel->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$center = $em->getRepository(Center::class)
|
|
||||||
->findOneBy(['name' => 'Center A']);
|
|
||||||
|
|
||||||
$qb = $em->createQueryBuilder();
|
$qb = $em->createQueryBuilder();
|
||||||
$personIds = $qb
|
$personIds = $qb
|
||||||
@ -80,8 +78,7 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase
|
|||||||
while ($nbGenerated < $maxGenerated) {
|
while ($nbGenerated < $maxGenerated) {
|
||||||
$id = array_pop($personIds)['id'];
|
$id = array_pop($personIds)['id'];
|
||||||
|
|
||||||
$person = $em->getRepository(Person::class)
|
$person = $em->getRepository(Person::class)->find($id);
|
||||||
->find($id);
|
|
||||||
$periods = $person->getAccompanyingPeriods();
|
$periods = $person->getAccompanyingPeriods();
|
||||||
|
|
||||||
yield [array_pop($personIds)['id'], $periods[array_rand($periods)]->getId()];
|
yield [array_pop($personIds)['id'], $periods[array_rand($periods)]->getId()];
|
||||||
|
@ -111,7 +111,7 @@ final class PersonAddressControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$crawler = $this->client->followRedirect();
|
$crawler = $this->client->followRedirect();
|
||||||
|
|
||||||
$this->assertRegexp(
|
$this->assertMatchesRegularExpression(
|
||||||
'|/fr/person/[0-9]{1,}/address/list|',
|
'|/fr/person/[0-9]{1,}/address/list|',
|
||||||
$this->client->getHistory()->current()->getUri(),
|
$this->client->getHistory()->current()->getUri(),
|
||||||
'assert that the current page is on |/fr/person/[0-9]{1,}/address/list|'
|
'assert that the current page is on |/fr/person/[0-9]{1,}/address/list|'
|
||||||
@ -169,7 +169,7 @@ final class PersonAddressControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$crawler = $this->client->followRedirect();
|
$crawler = $this->client->followRedirect();
|
||||||
|
|
||||||
$this->assertRegexp(
|
$this->assertMatchesRegularExpression(
|
||||||
'|/fr/person/[0-9]{1,}/address/list|',
|
'|/fr/person/[0-9]{1,}/address/list|',
|
||||||
$this->client->getHistory()->current()->getUri(),
|
$this->client->getHistory()->current()->getUri(),
|
||||||
'assert that the current page is on |/fr/person/[0-9]{1,}/address/list|'
|
'assert that the current page is on |/fr/person/[0-9]{1,}/address/list|'
|
||||||
|
@ -206,7 +206,7 @@ final class PersonControllerCreateTest extends WebTestCase
|
|||||||
$client->followRedirect();
|
$client->followRedirect();
|
||||||
|
|
||||||
// visualize regexp here : http://jex.im/regulex/#!embed=false&flags=&re=%2Ffr%2Fperson%2F[1-9][0-9]*%2Fgeneral%2Fedit%24
|
// visualize regexp here : http://jex.im/regulex/#!embed=false&flags=&re=%2Ffr%2Fperson%2F[1-9][0-9]*%2Fgeneral%2Fedit%24
|
||||||
$this->assertRegExp(
|
$this->assertMatchesRegularExpression(
|
||||||
'|/fr/person/[1-9][0-9]*/general/edit$|',
|
'|/fr/person/[1-9][0-9]*/general/edit$|',
|
||||||
$client->getHistory()->current()->getUri(),
|
$client->getHistory()->current()->getUri(),
|
||||||
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
||||||
@ -259,7 +259,7 @@ final class PersonControllerCreateTest extends WebTestCase
|
|||||||
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
||||||
);
|
);
|
||||||
$client->followRedirect();
|
$client->followRedirect();
|
||||||
$this->assertRegExp(
|
$this->assertMatchesRegularExpression(
|
||||||
'|/fr/person/[1-9][0-9]*/general/edit$|',
|
'|/fr/person/[1-9][0-9]*/general/edit$|',
|
||||||
$client->getHistory()->current()->getUri(),
|
$client->getHistory()->current()->getUri(),
|
||||||
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
'a valid form redirect to url /{_locale}/person/{personId}/general/edit'
|
||||||
|
@ -26,19 +26,19 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person manço');
|
$crawlerSpecial = $this->generateCrawlerForSearch('@person manço');
|
||||||
|
|
||||||
$this->assertRegExp('/MANÇO/', $crawlerSpecial->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/MANÇO/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||||
|
|
||||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person manco');
|
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person manco');
|
||||||
|
|
||||||
$this->assertRegExp('/MANÇO/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/MANÇO/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||||
|
|
||||||
$crawlerSpecial = $this->generateCrawlerForSearch('@person Étienne');
|
$crawlerSpecial = $this->generateCrawlerForSearch('@person Étienne');
|
||||||
|
|
||||||
$this->assertRegExp('/Étienne/', $crawlerSpecial->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Étienne/', $crawlerSpecial->filter('.list-with-period')->text());
|
||||||
|
|
||||||
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person etienne');
|
$crawlerNoSpecial = $this->generateCrawlerForSearch('@person etienne');
|
||||||
|
|
||||||
$this->assertRegExp('/Étienne/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Étienne/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testExpected()
|
public function testExpected()
|
||||||
@ -49,7 +49,7 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
'q' => '@person Depardieu',
|
'q' => '@person Depardieu',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertRegExp('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testExpectedNamed()
|
public function testExpectedNamed()
|
||||||
@ -60,79 +60,79 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
'q' => '@person Depardieu', 'name' => 'person_regular',
|
'q' => '@person Depardieu', 'name' => 'person_regular',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertRegExp('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/MANÇO/', $crawlerNoSpecial->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchBirthdate()
|
public function testSearchBirthdate()
|
||||||
{
|
{
|
||||||
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27');
|
$crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27');
|
||||||
|
|
||||||
$this->assertRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertRegExp('/Bart/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Bart/', $crawler->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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Gérard/', $crawlerNoSpecial->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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchCombineBirthdateAndLastName()
|
public function testSearchCombineBirthdateAndLastName()
|
||||||
@ -140,8 +140,8 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$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->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Bart/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
$this->assertDoesNotMatchRegularExpression('/DEPARDIEU/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchCombineGenderAndLastName()
|
public function testSearchCombineGenderAndLastName()
|
||||||
@ -149,8 +149,8 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)');
|
$crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)');
|
||||||
|
|
||||||
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
$this->assertDoesNotMatchRegularExpression('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchCombineLastnameAndFirstName()
|
public function testSearchCombineLastnameAndFirstName()
|
||||||
@ -158,9 +158,9 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu firstname:Jean');
|
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu firstname:Jean');
|
||||||
|
|
||||||
$this->assertRegExp('/Depardieu/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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(
|
$this->assertDoesNotMatchRegularExpression(
|
||||||
'/Gérard/',
|
'/Gérard/',
|
||||||
$crawler->filter('.list-with-period')->text(),
|
$crawler->filter('.list-with-period')->text(),
|
||||||
'assert clause firstname and nationality are AND'
|
'assert clause firstname and nationality are AND'
|
||||||
@ -172,9 +172,9 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu nationality:RU');
|
$crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu nationality:RU');
|
||||||
|
|
||||||
$this->assertRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/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(
|
$this->assertDoesNotMatchRegularExpression(
|
||||||
'/Jean/',
|
'/Jean/',
|
||||||
$crawler->filter('.list-with-period')->text(),
|
$crawler->filter('.list-with-period')->text(),
|
||||||
'assert clause firstname and nationality are AND'
|
'assert clause firstname and nationality are AND'
|
||||||
@ -186,9 +186,9 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$this->markTestSkipped('skipped until adapted to new fixtures');
|
$this->markTestSkipped('skipped until adapted to new fixtures');
|
||||||
$crawler = $this->generateCrawlerForSearch('@person cha dep');
|
$crawler = $this->generateCrawlerForSearch('@person cha dep');
|
||||||
|
|
||||||
$this->assertRegExp('/Charline/', $crawler->filter('.list-with-period')->text());
|
$this->assertMatchesRegularExpression('/Charline/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Gérard/', $crawler->filter('.list-with-period')->text());
|
$this->assertDoesNotMatchRegularExpression('/Gérard/', $crawler->filter('.list-with-period')->text());
|
||||||
$this->assertNotRegExp('/Jean/', $crawler->filter('.list-with-period')->text());
|
$this->assertDoesNotMatchRegularExpression('/Jean/', $crawler->filter('.list-with-period')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -199,12 +199,12 @@ final class PersonSearchTest extends WebTestCase
|
|||||||
$crawlerCanSee = $this->generateCrawlerForSearch('Gérard', 'center a_social');
|
$crawlerCanSee = $this->generateCrawlerForSearch('Gérard', 'center a_social');
|
||||||
$crawlerCannotSee = $this->generateCrawlerForSearch('Gérard', 'center b_social');
|
$crawlerCannotSee = $this->generateCrawlerForSearch('Gérard', 'center b_social');
|
||||||
|
|
||||||
$this->assertRegExp(
|
$this->assertMatchesRegularExpression(
|
||||||
'/DEPARDIEU/',
|
'/DEPARDIEU/',
|
||||||
$crawlerCanSee->text(),
|
$crawlerCanSee->text(),
|
||||||
'center a_social may see "Depardieu" in center a'
|
'center a_social may see "Depardieu" in center a'
|
||||||
);
|
);
|
||||||
$this->assertNotRegExp(
|
$this->assertDoesNotMatchRegularExpression(
|
||||||
'/DEPARDIEU/',
|
'/DEPARDIEU/',
|
||||||
$crawlerCannotSee->text(),
|
$crawlerCannotSee->text(),
|
||||||
'center b_social may not see "Depardieu" in center b'
|
'center b_social may not see "Depardieu" in center b'
|
||||||
|
@ -212,7 +212,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$linkSee = $crawler->filter('.bt-view')->links();
|
$linkSee = $crawler->filter('.bt-view')->links();
|
||||||
$this->assertGreaterThan(0, count($linkSee));
|
$this->assertGreaterThan(0, count($linkSee));
|
||||||
$this->assertRegExp(sprintf(
|
$this->assertMatchesRegularExpression(sprintf(
|
||||||
'|/fr/person/%s/report/[0-9]*/view$|',
|
'|/fr/person/%s/report/[0-9]*/view$|',
|
||||||
self::$person->getId(),
|
self::$person->getId(),
|
||||||
$reportId
|
$reportId
|
||||||
@ -220,7 +220,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$linkUpdate = $crawler->filter('.bt-update')->links();
|
$linkUpdate = $crawler->filter('.bt-update')->links();
|
||||||
$this->assertGreaterThan(0, count($linkUpdate));
|
$this->assertGreaterThan(0, count($linkUpdate));
|
||||||
$this->assertRegExp(sprintf(
|
$this->assertMatchesRegularExpression(sprintf(
|
||||||
'|/fr/person/%s/report/[0-9]*/edit$|',
|
'|/fr/person/%s/report/[0-9]*/edit$|',
|
||||||
self::$person->getId(),
|
self::$person->getId(),
|
||||||
$reportId
|
$reportId
|
||||||
@ -372,7 +372,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
);
|
);
|
||||||
$client->followRedirect();
|
$client->followRedirect();
|
||||||
|
|
||||||
$this->assertRegExp(
|
$this->assertMatchesRegularExpression(
|
||||||
'|/fr/person/' . self::$person->getId() . '/report/[0-9]*/view$|',
|
'|/fr/person/' . self::$person->getId() . '/report/[0-9]*/view$|',
|
||||||
$client->getHistory()->current()->getUri(),
|
$client->getHistory()->current()->getUri(),
|
||||||
"The next page is a redirection to the new report's view page"
|
"The next page is a redirection to the new report's view page"
|
||||||
|
@ -43,7 +43,7 @@ final class ReportSearchTest extends WebTestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||||
$this->assertRegExp('/Situation de logement/i', $crawler->text());
|
$this->assertMatchesRegularExpression('/Situation de logement/i', $crawler->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchDoubleDate()
|
public function testSearchDoubleDate()
|
||||||
@ -77,7 +77,7 @@ final class ReportSearchTest extends WebTestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||||
$this->assertRegExp('/Situation de logement/i', $crawler->text());
|
$this->assertMatchesRegularExpression('/Situation de logement/i', $crawler->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user