mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
26 lines
751 B
PHP
26 lines
751 B
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\TaskManager\Event;
|
|
|
|
use Alchemy\Phrasea\TaskManager\Event\FinishedJobRemoverSubscriber;
|
|
use Alchemy\Phrasea\TaskManager\Event\JobFinishedEvent;
|
|
use Alchemy\Phrasea\Model\Entities\Task;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class FinishedJobRemoverSubscriberTest extends \PhraseanetTestCase
|
|
{
|
|
public function testOnJobFinish()
|
|
{
|
|
$task = self::$DI['app']['orm.em']->find('Phraseanet:Task', 1);
|
|
$taskId = $task->getId();
|
|
|
|
$subscriber = new FinishedJobRemoverSubscriber(self::$DI['app']['orm.em']);
|
|
$subscriber->onJobFinish(new JobFinishedEvent($task));
|
|
|
|
$this->assertNull(self::$DI['app']['orm.em']->getRepository('Phraseanet:Task')->find($taskId));
|
|
}
|
|
}
|