mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
Fix unit tests
This commit is contained in:
@@ -563,18 +563,7 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
$taskManager = self::$DI['app']['task-manager'];
|
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
||||||
$tasks = $taskManager->getTasks();
|
|
||||||
|
|
||||||
$found = false;
|
|
||||||
foreach ($tasks as $task) {
|
|
||||||
if (get_class($task) === 'task_period_emptyColl') {
|
|
||||||
$found = true;
|
|
||||||
$task->delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $found) {
|
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -682,18 +682,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
$taskManager = self::$DI['app']['task-manager'];
|
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
||||||
$tasks = $taskManager->getTasks();
|
|
||||||
|
|
||||||
$found = false;
|
|
||||||
foreach ($tasks as $task) {
|
|
||||||
if (get_class($task) === 'task_period_emptyColl') {
|
|
||||||
$found = true;
|
|
||||||
$task->delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$found) {
|
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user