mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Command\Task;
|
|
|
|
use Alchemy\Phrasea\Command\Task\TaskRun;
|
|
use Alchemy\Phrasea\Model\Entities\Task;
|
|
|
|
class TaskRunTest extends \PhraseanetTestCase
|
|
{
|
|
public function testRunWithoutProblems()
|
|
{
|
|
$input = $this->getMock('Symfony\Component\Console\Input\InputInterface');
|
|
$output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
|
|
|
|
$input->expects($this->any())
|
|
->method('getArgument')
|
|
->with('task_id')
|
|
->will($this->returnValue(1));
|
|
|
|
$command = new TaskRun();
|
|
$command->setContainer(self::$DI['cli']);
|
|
|
|
$job = $this->getMock('Alchemy\Phrasea\TaskManager\Job\JobInterface');
|
|
|
|
self::$DI['cli']['task-manager.job-factory'] = $this->getMockBuilder('Alchemy\Phrasea\TaskManager\Job\Factory')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
self::$DI['cli']['task-manager.job-factory']->expects($this->once())
|
|
->method('create')
|
|
->will($this->returnValue($job));
|
|
|
|
$job->expects($this->once())
|
|
->method('run');
|
|
$job->expects($this->exactly(2))
|
|
->method('addSubscriber');
|
|
|
|
$command->execute($input, $output);
|
|
}
|
|
}
|