diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php index cf77544c78..2c25143b39 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php @@ -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'); } } diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php index 11ba7a2cb4..c7a4eb4728 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php @@ -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'); }