Files
Phraseanet/tests/Alchemy/Tests/Phrasea/TaskManager/Log/LogFileFactoryTest.php
2015-06-15 19:30:51 +02:00

35 lines
993 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\TaskManager\Log;
use Alchemy\Phrasea\TaskManager\Log\LogFileFactory;
use Alchemy\Phrasea\Model\Entities\Task;
/**
* @group functional
* @group legacy
*/
class LogFileFactoryTest extends \PhraseanetTestCase
{
public function testForTask()
{
$task = self::$DI['app']['orm.em']->find('Phraseanet:Task', 1);
$root = __DIR__ . '/root';
$factory = new LogFilefactory($root);
$log = $factory->forTask($task);
$this->assertInstanceOf('Alchemy\Phrasea\TaskManager\Log\TaskLogFile', $log);
$this->assertSame($task, $log->getTask());
$this->assertSame($root, $log->getRoot());
}
public function testForManager()
{
$root = __DIR__ . '/root';
$factory = new LogFilefactory($root);
$log = $factory->forManager();
$this->assertInstanceOf('Alchemy\Phrasea\TaskManager\Log\ManagerLogFile', $log);
$this->assertSame($root, $log->getRoot());
}
}