mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +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());
|
||||
$this->assertTrue($json->success);
|
||||
|
||||
$taskManager = self::$DI['app']['task-manager'];
|
||||
$tasks = $taskManager->getTasks();
|
||||
|
||||
$found = false;
|
||||
foreach ($tasks as $task) {
|
||||
if (get_class($task) === 'task_period_emptyColl') {
|
||||
$found = true;
|
||||
$task->delete();
|
||||
}
|
||||
}
|
||||
|
||||
if (! $found) {
|
||||
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
||||
$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());
|
||||
$this->assertTrue($json->success);
|
||||
|
||||
$taskManager = self::$DI['app']['task-manager'];
|
||||
$tasks = $taskManager->getTasks();
|
||||
|
||||
$found = false;
|
||||
foreach ($tasks as $task) {
|
||||
if (get_class($task) === 'task_period_emptyColl') {
|
||||
$found = true;
|
||||
$task->delete();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
||||
$this->fail('Task for empty collection has not been created');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user