mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
Fix phpunit tests
This commit is contained in:
@@ -164,10 +164,10 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
|
||||
);
|
||||
}
|
||||
|
||||
protected function assertFormOrAngularError(Crawler $crawler, $quantity)
|
||||
protected function assertFormOrFlashError(Crawler $crawler, $quantity)
|
||||
{
|
||||
$total = $crawler->filter('form div:not(div[ng-show]) > div.popover.field-error')->count();
|
||||
$total += $crawler->filter('phraseanet-flash[type="error"]')->count();
|
||||
$total += $crawler->filter('.alert')->count();
|
||||
|
||||
$this->assertEquals($quantity, $total);
|
||||
}
|
||||
@@ -190,19 +190,6 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
|
||||
}
|
||||
}
|
||||
|
||||
protected function assertAngularFlashMessage(Crawler $crawler, $flashType, $quantity, $message = null, $offset = 0)
|
||||
{
|
||||
if (!preg_match('/[a-zA-Z]+/', $flashType)) {
|
||||
$this->fail(sprintf('FlashType must be in the form of [a-zA-Z]+, %s given', $flashType));
|
||||
}
|
||||
|
||||
$this->assertEquals($quantity, $crawler->filter('phraseanet-flash[type="'.$flashType.'"]')->count());
|
||||
|
||||
if (null !== $message) {
|
||||
$this->assertEquals($message, $crawler->filter('phraseanet-flash[type="'.$flashType.'"]')->eq($offset)->text());
|
||||
}
|
||||
}
|
||||
|
||||
protected function assertFlashMessagePopulated(Application $app, $flashType, $quantity)
|
||||
{
|
||||
if (!preg_match('/[a-zA-Z]+/', $flashType)) {
|
||||
|
Reference in New Issue
Block a user