Fix unit tests

This commit is contained in:
Romain Neutron
2013-10-07 19:44:14 +02:00
parent 992d520a67
commit 2d3e18f95b
2 changed files with 2 additions and 24 deletions

View File

@@ -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');
}
}

View File

@@ -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');
}