Fix phpunit tests

This commit is contained in:
Nicolas Le Goff
2013-06-11 17:53:06 +02:00
parent 12c7e7e3bb
commit 5fe2f4d554
2 changed files with 10 additions and 23 deletions

View File

@@ -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)) {