mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Fix latest rebase
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
namespace Alchemy\Phrasea\Command\Task;
|
namespace Alchemy\Phrasea\Command\Task;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Command;
|
use Alchemy\Phrasea\Command\Command;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Alchemy\Phrasea\Form\TaskForm;
|
use Alchemy\Phrasea\Form\TaskForm;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Controller\Converter;
|
|||||||
|
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskConverter implements ConverterInterface
|
class TaskConverter implements ConverterInterface
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ class TaskConverter implements ConverterInterface
|
|||||||
*/
|
*/
|
||||||
public function convert($id)
|
public function convert($id)
|
||||||
{
|
{
|
||||||
if (null === $task = $this->om->find('Entities\Task', (int) $id)) {
|
if (null === $task = $this->om->find('Alchemy\Phrasea\Model\Entities\Task', (int) $id)) {
|
||||||
throw new NotFoundHttpException(sprintf('Task %s not found.', $id));
|
throw new NotFoundHttpException(sprintf('Task %s not found.', $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
|
|||||||
$finder = new PhpExecutableFinder();
|
$finder = new PhpExecutableFinder();
|
||||||
$php = $finder->find();
|
$php = $finder->find();
|
||||||
|
|
||||||
return new TaskList($app['EM']->getRepository('Entities\Task'), $app['root.path'], $php, $conf);
|
return new TaskList($app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task'), $app['root.path'], $php, $conf);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Form;
|
namespace Alchemy\Phrasea\Form;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
@@ -38,8 +39,8 @@ class TaskForm extends AbstractType
|
|||||||
$builder->add('status', 'choice', array(
|
$builder->add('status', 'choice', array(
|
||||||
'label' => _('The task status'),
|
'label' => _('The task status'),
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
\Entities\Task::STATUS_STARTED => 'Started',
|
Task::STATUS_STARTED => 'Started',
|
||||||
\Entities\Task::STATUS_STOPPED => 'Stopped',
|
Task::STATUS_STOPPED => 'Stopped',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
$builder->add('settings', 'hidden');
|
$builder->add('settings', 'hidden');
|
||||||
@@ -48,7 +49,7 @@ class TaskForm extends AbstractType
|
|||||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'data_class' => 'Entities\Task',
|
'data_class' => 'Alchemy\Phrasea\Model\Entities\Task',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Entities;
|
namespace Alchemy\Phrasea\Model\Entities;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@@ -17,7 +17,7 @@ use Gedmo\Mapping\Annotation as Gedmo;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Table(name="Tasks")
|
* @ORM\Table(name="Tasks")
|
||||||
* @ORM\Entity(repositoryClass="Repositories\TaskRepository")
|
* @ORM\Entity(repositoryClass="Alchemy\Phrasea\Model\Repositories\TaskRepository")
|
||||||
*/
|
*/
|
||||||
class Task
|
class Task
|
||||||
{
|
{
|
@@ -14,7 +14,7 @@ namespace Alchemy\Phrasea\Model\Manipulator;
|
|||||||
use Alchemy\Phrasea\TaskManager\Job\EmptyCollectionJob;
|
use Alchemy\Phrasea\TaskManager\Job\EmptyCollectionJob;
|
||||||
use Alchemy\Phrasea\TaskManager\Notifier;
|
use Alchemy\Phrasea\TaskManager\Notifier;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskManipulator implements ManipulatorInterface
|
class TaskManipulator implements ManipulatorInterface
|
||||||
{
|
{
|
||||||
@@ -174,6 +174,6 @@ class TaskManipulator implements ManipulatorInterface
|
|||||||
*/
|
*/
|
||||||
public function getRepository()
|
public function getRepository()
|
||||||
{
|
{
|
||||||
return $this->om->getRepository('Entities\Task');
|
return $this->om->getRepository('Alchemy\Phrasea\Model\Entities\Task');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Alchemy\Phrasea\Model\Repositories;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Entities\Task;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TaskRepository
|
* TaskRepository
|
||||||
@@ -17,9 +17,9 @@ class TaskRepository extends EntityRepository
|
|||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('t');
|
$qb = $this->createQueryBuilder('t');
|
||||||
$qb->where('t.status = :status');
|
$qb->where('t.status = :status');
|
||||||
|
|
||||||
$qb->setParameter(':status', Task::STATUS_STARTED);
|
$qb->setParameter(':status', Task::STATUS_STARTED);
|
||||||
|
|
||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\TaskManager\Event;
|
namespace Alchemy\Phrasea\TaskManager\Event;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
|
|
||||||
class JobFinishedEvent extends Event
|
class JobFinishedEvent extends Event
|
||||||
|
@@ -16,7 +16,7 @@ use Alchemy\Phrasea\TaskManager\Editor\FtpEditor;
|
|||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender;
|
use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender;
|
||||||
use Alchemy\Phrasea\Notification\Receiver;
|
use Alchemy\Phrasea\Notification\Receiver;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Entities\FtpExport;
|
use Entities\FtpExport;
|
||||||
use Entities\FtpExportElement;
|
use Entities\FtpExportElement;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager\Job;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\TaskManager\JobDataInterface;
|
use Alchemy\TaskManager\JobDataInterface;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class JobData implements JobDataInterface
|
class JobData implements JobDataInterface
|
||||||
{
|
{
|
||||||
|
@@ -15,7 +15,7 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
use Alchemy\Phrasea\TaskManager\Editor\PhraseanetIndexerEditor;
|
use Alchemy\Phrasea\TaskManager\Editor\PhraseanetIndexerEditor;
|
||||||
use Alchemy\Phrasea\TaskManager\Event\PhraseanetIndexerStopperSubscriber;
|
use Alchemy\Phrasea\TaskManager\Event\PhraseanetIndexerStopperSubscriber;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\Process\ProcessBuilder;
|
use Symfony\Component\Process\ProcessBuilder;
|
||||||
|
|
||||||
class PhraseanetIndexerJob extends AbstractJob
|
class PhraseanetIndexerJob extends AbstractJob
|
||||||
|
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Notifier;
|
use Alchemy\Phrasea\TaskManager\Notifier;
|
||||||
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class LiveInformation
|
class LiveInformation
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\TaskManager\Log;
|
namespace Alchemy\Phrasea\TaskManager\Log;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class LogFileFactory
|
class LogFileFactory
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\TaskManager\Log;
|
namespace Alchemy\Phrasea\TaskManager\Log;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskLogFile extends AbstractLogFile implements LogFileInterface
|
class TaskLogFile extends AbstractLogFile implements LogFileInterface
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\TaskManager;
|
namespace Alchemy\Phrasea\TaskManager;
|
||||||
|
|
||||||
use Entities\Task as TaskEntity;
|
use Alchemy\Phrasea\Model\Entities\Task as TaskEntity;
|
||||||
use Alchemy\TaskManager\TaskInterface;
|
use Alchemy\TaskManager\TaskInterface;
|
||||||
use Symfony\Component\Process\Process;
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
|
@@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\TaskManager;
|
namespace Alchemy\Phrasea\TaskManager;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Model\Entities\Task as TaskEntity;
|
||||||
|
use Alchemy\Phrasea\Model\Repositories\TaskRepository;
|
||||||
use Alchemy\TaskManager\TaskListInterface;
|
use Alchemy\TaskManager\TaskListInterface;
|
||||||
use Symfony\Component\Process\ProcessBuilder;
|
use Symfony\Component\Process\ProcessBuilder;
|
||||||
use Entities\Task as TaskEntity;
|
|
||||||
use Repositories\TaskRepository;
|
|
||||||
|
|
||||||
class TaskList implements TaskListInterface
|
class TaskList implements TaskListInterface
|
||||||
{
|
{
|
||||||
|
@@ -10,8 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Entities\Task;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class patch_3908 implements patchInterface
|
class patch_3908 implements patchInterface
|
||||||
{
|
{
|
||||||
|
@@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\File;
|
|||||||
use Alchemy\Phrasea\Border\Manager;
|
use Alchemy\Phrasea\Border\Manager;
|
||||||
use Alchemy\Phrasea\Core\PhraseaEvents;
|
use Alchemy\Phrasea\Core\PhraseaEvents;
|
||||||
use Alchemy\Phrasea\Authentication\Context;
|
use Alchemy\Phrasea\Authentication\Context;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\HttpKernel\Client;
|
use Symfony\Component\HttpKernel\Client;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\Command\Task;
|
namespace Alchemy\Tests\Phrasea\Command\Task;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\TaskRun;
|
use Alchemy\Phrasea\Command\Task\TaskRun;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskRunTest extends \PhraseanetPHPUnitAbstract
|
class TaskRunTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\Command\Task;
|
namespace Alchemy\Tests\Phrasea\Command\Task;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\TaskStart;
|
use Alchemy\Phrasea\Command\Task\TaskStart;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStartTest extends \PhraseanetPHPUnitAbstract
|
class TaskStartTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\Command\Task;
|
namespace Alchemy\Tests\Phrasea\Command\Task;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\TaskState;
|
use Alchemy\Phrasea\Command\Task\TaskState;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStateTest extends \PhraseanetPHPUnitAbstract
|
class TaskStateTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\Command\Task;
|
namespace Alchemy\Tests\Phrasea\Command\Task;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Task\TaskStop;
|
use Alchemy\Phrasea\Command\Task\TaskStop;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskStopTest extends \PhraseanetPHPUnitAbstract
|
class TaskStopTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -563,7 +563,7 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
if (count(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll()) === 0) {
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -682,7 +682,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$json = $this->getJson(self::$DI['client']->getResponse());
|
$json = $this->getJson(self::$DI['client']->getResponse());
|
||||||
$this->assertTrue($json->success);
|
$this->assertTrue($json->success);
|
||||||
|
|
||||||
if (count(self::$DI['app']['EM']->getRepository('Entities\Task')->findAll()) === 0) {
|
if (count(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll()) === 0) {
|
||||||
$this->fail('Task for empty collection has not been created');
|
$this->fail('Task for empty collection has not been created');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Controller\Admin;
|
namespace Alchemy\Tests\Phrasea\Controller\Admin;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class TaskManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
class TaskManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||||
@@ -109,7 +109,7 @@ class TaskManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
$this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||||
$this->assertEquals('/admin/task-manager/tasks', self::$DI['client']->getResponse()->headers->get('location'));
|
$this->assertEquals('/admin/task-manager/tasks', self::$DI['client']->getResponse()->headers->get('location'));
|
||||||
|
|
||||||
$this->assertNull(self::$DI['app']['EM']->find('Entities\Task', $taskId));
|
$this->assertNull(self::$DI['app']['EM']->find('Alchemy\Phrasea\Model\Entities\Task', $taskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPostTaskStart()
|
public function testPostTaskStart()
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Phrasea\Controller\Converter;
|
namespace Alchemy\Phrasea\Controller\Converter;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Controller\Converter\TaskConverter;
|
use Alchemy\Phrasea\Controller\Converter\TaskConverter;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskConverterTest extends \PhraseanetPHPUnitAbstract
|
class TaskConverterTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Model\Manipulator\TaskManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\TaskManipulator;
|
||||||
use Alchemy\Phrasea\TaskManager\Notifier;
|
use Alchemy\Phrasea\TaskManager\Notifier;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract
|
class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
public function testGetRepository()
|
public function testGetRepository()
|
||||||
{
|
{
|
||||||
$manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock());
|
$manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock());
|
||||||
$this->assertSame(self::$DI['app']['EM']->getRepository('Entities\Task'), $manipulator->getRepository());
|
$this->assertSame(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task'), $manipulator->getRepository());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreateEmptyCollection()
|
public function testCreateEmptyCollection()
|
||||||
@@ -119,7 +119,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
$manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock());
|
$manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock());
|
||||||
$task = $manipulator->createEmptyCollectionJob($collection);
|
$task = $manipulator->createEmptyCollectionJob($collection);
|
||||||
|
|
||||||
$tasks = self::$DI['app']['EM']->getRepository('Entities\Task')->findAll();
|
$tasks = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll();
|
||||||
$this->assertSame('EmptyCollection', $task->getJobId());
|
$this->assertSame('EmptyCollection', $task->getJobId());
|
||||||
$this->assertSame(array($task), $tasks);
|
$this->assertSame(array($task), $tasks);
|
||||||
$settings = simplexml_load_string($task->getSettings());
|
$settings = simplexml_load_string($task->getSettings());
|
||||||
@@ -127,7 +127,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
private function findAllTasks()
|
private function findAllTasks()
|
||||||
{
|
{
|
||||||
return self::$DI['app']['EM']->getRepository('Entities\Task')->findAll();
|
return self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadTask()
|
private function loadTask()
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Doctrine\Tests\Repositories;
|
namespace Alchemy\Tests\Phrasea\Model\Repositories;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskRepositoryTest extends \PhraseanetPHPUnitAbstract
|
class TaskRepositoryTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ class TaskRepositoryTest extends \PhraseanetPHPUnitAbstract
|
|||||||
self::$DI['app']['EM']->persist($task2);
|
self::$DI['app']['EM']->persist($task2);
|
||||||
self::$DI['app']['EM']->flush();
|
self::$DI['app']['EM']->flush();
|
||||||
|
|
||||||
$repository = self::$DI['app']['EM']->getRepository('Entities\Task');
|
$repository = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task');
|
||||||
$this->assertSame(array($task2), $repository->findActiveTasks());
|
$this->assertSame(array($task2), $repository->findActiveTasks());
|
||||||
|
|
||||||
$task1->setStatus(Task::STATUS_STARTED);
|
$task1->setStatus(Task::STATUS_STARTED);
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Event;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Event\FinishedJobRemoverSubscriber;
|
use Alchemy\Phrasea\TaskManager\Event\FinishedJobRemoverSubscriber;
|
||||||
use Alchemy\Phrasea\TaskManager\Event\JobFinishedEvent;
|
use Alchemy\Phrasea\TaskManager\Event\JobFinishedEvent;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class FinishedJobRemoverSubscriberTest extends \PhraseanetPHPUnitAbstract
|
class FinishedJobRemoverSubscriberTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
@@ -21,6 +21,6 @@ class FinishedJobRemoverSubscriberTest extends \PhraseanetPHPUnitAbstract
|
|||||||
$subscriber = new FinishedJobRemoverSubscriber(self::$DI['app']['EM']);
|
$subscriber = new FinishedJobRemoverSubscriber(self::$DI['app']['EM']);
|
||||||
$subscriber->onJobFinish(new JobFinishedEvent($task));
|
$subscriber->onJobFinish(new JobFinishedEvent($task));
|
||||||
|
|
||||||
$this->assertNull(self::$DI['app']['EM']->getRepository('Entities\Task')->find($taskId));
|
$this->assertNull(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task')->find($taskId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ class JobFinishedEventTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
public function testEvent()
|
public function testEvent()
|
||||||
{
|
{
|
||||||
$task = $this->getMock('Entities\Task');
|
$task = $this->getMock('Alchemy\Phrasea\Model\Entities\Task');
|
||||||
$event = new JobFinishedEvent($task);
|
$event = new JobFinishedEvent($task);
|
||||||
$this->assertSame($task, $event->getTask());
|
$this->assertSame($task, $event->getTask());
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ class JobDataTest extends \PHPUnit_Framework_TestCase
|
|||||||
$app = $this->getMockBuilder('Alchemy\Phrasea\Application')
|
$app = $this->getMockBuilder('Alchemy\Phrasea\Application')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$task = $this->getMockBuilder('Entities\Task')
|
$task = $this->getMockBuilder('Alchemy\Phrasea\Model\Entities\Task')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$data = new JobData($app, $task);
|
$data = new JobData($app, $task);
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Job;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Job\SubdefsJob;
|
use Alchemy\Phrasea\TaskManager\Job\SubdefsJob;
|
||||||
use Alchemy\Phrasea\TaskManager\Job\JobData;
|
use Alchemy\Phrasea\TaskManager\Job\JobData;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class SubdefsJobTest extends JobTestCase
|
class SubdefsJobTest extends JobTestCase
|
||||||
{
|
{
|
||||||
@@ -12,7 +12,7 @@ class SubdefsJobTest extends JobTestCase
|
|||||||
{
|
{
|
||||||
return new SubdefsJob();
|
return new SubdefsJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doTestRun()
|
public function doTestRun()
|
||||||
{
|
{
|
||||||
$job = $this->getJob();
|
$job = $this->getJob();
|
||||||
|
@@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Job;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Job\WriteMetadataJob;
|
use Alchemy\Phrasea\TaskManager\Job\WriteMetadataJob;
|
||||||
use Alchemy\Phrasea\TaskManager\Job\JobData;
|
use Alchemy\Phrasea\TaskManager\Job\JobData;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class WriteMetadataJobTest extends JobTestCase
|
class WriteMetadataJobTest extends JobTestCase
|
||||||
{
|
{
|
||||||
@@ -12,7 +12,7 @@ class WriteMetadataJobTest extends JobTestCase
|
|||||||
{
|
{
|
||||||
return new WriteMetadataJob();
|
return new WriteMetadataJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doTestRun()
|
public function doTestRun()
|
||||||
{
|
{
|
||||||
$job = $this->getJob();
|
$job = $this->getJob();
|
||||||
|
@@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager;
|
|||||||
use Alchemy\Phrasea\TaskManager\LiveInformation;
|
use Alchemy\Phrasea\TaskManager\LiveInformation;
|
||||||
use Alchemy\Phrasea\TaskManager\Notifier;
|
use Alchemy\Phrasea\TaskManager\Notifier;
|
||||||
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class LiveInformationTest extends \PhraseanetPHPUnitAbstract
|
class LiveInformationTest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\TaskManager\Log;
|
namespace Alchemy\Tests\Phrasea\TaskManager\Log;
|
||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Log\LogFileFactory;
|
use Alchemy\Phrasea\TaskManager\Log\LogFileFactory;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class LogFilefactorytest extends \PhraseanetPHPUnitAbstract
|
class LogFilefactorytest extends \PhraseanetPHPUnitAbstract
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
namespace Alchemy\Tests\Phrasea\TaskManager\Log;
|
namespace Alchemy\Tests\Phrasea\TaskManager\Log;
|
||||||
|
|
||||||
use Alchemy\Phrasea\TaskManager\Log\TaskLogFile;
|
use Alchemy\Phrasea\TaskManager\Log\TaskLogFile;
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
class TaskLogFileTest extends LogFileTestCase
|
class TaskLogFileTest extends LogFileTestCase
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\TaskManager;
|
namespace Alchemy\Tests\Phrasea\TaskManager;
|
||||||
|
|
||||||
use Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Alchemy\Phrasea\TaskManager\TaskList;
|
use Alchemy\Phrasea\TaskManager\TaskList;
|
||||||
|
|
||||||
class TaskListTest extends \PhraseanetPHPUnitAbstract
|
class TaskListTest extends \PhraseanetPHPUnitAbstract
|
||||||
@@ -42,7 +42,7 @@ class TaskListTest extends \PhraseanetPHPUnitAbstract
|
|||||||
self::$DI['app']['EM']->persist($task2);
|
self::$DI['app']['EM']->persist($task2);
|
||||||
self::$DI['app']['EM']->flush();
|
self::$DI['app']['EM']->flush();
|
||||||
|
|
||||||
return new TaskList(self::$DI['app']['EM']->getRepository('Entities\Task'), self::$DI['app']['root.path'], '/path/to/php', '/path/to/php-conf');
|
return new TaskList(self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Task'), self::$DI['app']['root.path'], '/path/to/php', '/path/to/php-conf');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testThatProcessHaveNoTimeout()
|
public function testThatProcessHaveNoTimeout()
|
||||||
|
@@ -12,7 +12,7 @@ class TaskTest extends TaskTestCase
|
|||||||
$process = $this->getMockBuilder('Symfony\Component\Process\Process')
|
$process = $this->getMockBuilder('Symfony\Component\Process\Process')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$taskEntity = $this->getMock('Entities\Task');
|
$taskEntity = $this->getMock('Alchemy\Phrasea\Model\Entities\Task');
|
||||||
$task = new Task($taskEntity, 'task number', 42, $process);
|
$task = new Task($taskEntity, 'task number', 42, $process);
|
||||||
|
|
||||||
$created1 = $task->createProcess();
|
$created1 = $task->createProcess();
|
||||||
@@ -32,7 +32,7 @@ class TaskTest extends TaskTestCase
|
|||||||
$process = $this->getMockBuilder('Symfony\Component\Process\Process')
|
$process = $this->getMockBuilder('Symfony\Component\Process\Process')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$taskEntity = $this->getMock('Entities\Task');
|
$taskEntity = $this->getMock('Alchemy\Phrasea\Model\Entities\Task');
|
||||||
|
|
||||||
return new Task($taskEntity, 'task number', 42, $process);
|
return new Task($taskEntity, 'task number', 42, $process);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user