diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskList.php b/lib/Alchemy/Phrasea/Command/Task/TaskList.php index 7b1e166669..5bcf634ca8 100644 --- a/lib/Alchemy/Phrasea/Command/Task/TaskList.php +++ b/lib/Alchemy/Phrasea/Command/Task/TaskList.php @@ -12,7 +12,7 @@ namespace Alchemy\Phrasea\Command\Task; use Alchemy\Phrasea\Command\Command; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; diff --git a/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php index 73123b3ba8..6c71badfe8 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin; use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Form\TaskForm; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Silex\Application; use Silex\ControllerProviderInterface; use Symfony\Component\HttpFoundation\Request; diff --git a/lib/Alchemy/Phrasea/Controller/Converter/TaskConverter.php b/lib/Alchemy/Phrasea/Controller/Converter/TaskConverter.php index ccc2956029..939577eaba 100644 --- a/lib/Alchemy/Phrasea/Controller/Converter/TaskConverter.php +++ b/lib/Alchemy/Phrasea/Controller/Converter/TaskConverter.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Controller\Converter; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Doctrine\Common\Persistence\ObjectManager; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskConverter implements ConverterInterface { @@ -31,7 +31,7 @@ class TaskConverter implements ConverterInterface */ 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)); } diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/TaskManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/TaskManagerServiceProvider.php index 975136c558..2f9a6a3f87 100644 --- a/lib/Alchemy/Phrasea/Core/CLIProvider/TaskManagerServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/CLIProvider/TaskManagerServiceProvider.php @@ -50,7 +50,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface $finder = new PhpExecutableFinder(); $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); }); } diff --git a/lib/Alchemy/Phrasea/Form/TaskForm.php b/lib/Alchemy/Phrasea/Form/TaskForm.php index 77118bf415..04b7489a5c 100644 --- a/lib/Alchemy/Phrasea/Form/TaskForm.php +++ b/lib/Alchemy/Phrasea/Form/TaskForm.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Form; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; @@ -38,8 +39,8 @@ class TaskForm extends AbstractType $builder->add('status', 'choice', array( 'label' => _('The task status'), 'choices' => array( - \Entities\Task::STATUS_STARTED => 'Started', - \Entities\Task::STATUS_STOPPED => 'Stopped', + Task::STATUS_STARTED => 'Started', + Task::STATUS_STOPPED => 'Stopped', ), )); $builder->add('settings', 'hidden'); @@ -48,7 +49,7 @@ class TaskForm extends AbstractType public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( - 'data_class' => 'Entities\Task', + 'data_class' => 'Alchemy\Phrasea\Model\Entities\Task', )); } diff --git a/lib/Doctrine/Entities/Task.php b/lib/Alchemy/Phrasea/Model/Entities/Task.php similarity index 97% rename from lib/Doctrine/Entities/Task.php rename to lib/Alchemy/Phrasea/Model/Entities/Task.php index 3e35800f8e..96abe00c51 100644 --- a/lib/Doctrine/Entities/Task.php +++ b/lib/Alchemy/Phrasea/Model/Entities/Task.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Entities; +namespace Alchemy\Phrasea\Model\Entities; use Alchemy\Phrasea\Exception\InvalidArgumentException; use Doctrine\ORM\Mapping as ORM; @@ -17,7 +17,7 @@ use Gedmo\Mapping\Annotation as Gedmo; /** * @ORM\Table(name="Tasks") - * @ORM\Entity(repositoryClass="Repositories\TaskRepository") + * @ORM\Entity(repositoryClass="Alchemy\Phrasea\Model\Repositories\TaskRepository") */ class Task { diff --git a/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php b/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php index e3df8df48b..f361c1ace9 100644 --- a/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php +++ b/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php @@ -14,7 +14,7 @@ namespace Alchemy\Phrasea\Model\Manipulator; use Alchemy\Phrasea\TaskManager\Job\EmptyCollectionJob; use Alchemy\Phrasea\TaskManager\Notifier; use Doctrine\Common\Persistence\ObjectManager; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskManipulator implements ManipulatorInterface { @@ -174,6 +174,6 @@ class TaskManipulator implements ManipulatorInterface */ public function getRepository() { - return $this->om->getRepository('Entities\Task'); + return $this->om->getRepository('Alchemy\Phrasea\Model\Entities\Task'); } } diff --git a/lib/Doctrine/Repositories/TaskRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/TaskRepository.php similarity index 83% rename from lib/Doctrine/Repositories/TaskRepository.php rename to lib/Alchemy/Phrasea/Model/Repositories/TaskRepository.php index 814cd638c0..8b510b2c8b 100644 --- a/lib/Doctrine/Repositories/TaskRepository.php +++ b/lib/Alchemy/Phrasea/Model/Repositories/TaskRepository.php @@ -1,9 +1,9 @@ createQueryBuilder('t'); $qb->where('t.status = :status'); - + $qb->setParameter(':status', Task::STATUS_STARTED); - + return $qb->getQuery()->getResult(); } } diff --git a/lib/Alchemy/Phrasea/TaskManager/Event/JobFinishedEvent.php b/lib/Alchemy/Phrasea/TaskManager/Event/JobFinishedEvent.php index 48f19c6149..dcdb5a3ba7 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Event/JobFinishedEvent.php +++ b/lib/Alchemy/Phrasea/TaskManager/Event/JobFinishedEvent.php @@ -11,7 +11,7 @@ namespace Alchemy\Phrasea\TaskManager\Event; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\EventDispatcher\Event; class JobFinishedEvent extends Event diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php index 7a249bfb46..199de4cdfc 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php +++ b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php @@ -16,7 +16,7 @@ use Alchemy\Phrasea\TaskManager\Editor\FtpEditor; use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender; use Alchemy\Phrasea\Notification\Receiver; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Entities\FtpExport; use Entities\FtpExportElement; diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/JobData.php b/lib/Alchemy/Phrasea/TaskManager/Job/JobData.php index c294a6cde5..e96641d3ff 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Job/JobData.php +++ b/lib/Alchemy/Phrasea/TaskManager/Job/JobData.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager\Job; use Alchemy\Phrasea\Application; use Alchemy\TaskManager\JobDataInterface; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class JobData implements JobDataInterface { diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/PhraseanetIndexerJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/PhraseanetIndexerJob.php index 670e2cc7b4..a2e93f732c 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Job/PhraseanetIndexerJob.php +++ b/lib/Alchemy/Phrasea/TaskManager/Job/PhraseanetIndexerJob.php @@ -15,7 +15,7 @@ use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\TaskManager\Editor\PhraseanetIndexerEditor; use Alchemy\Phrasea\TaskManager\Event\PhraseanetIndexerStopperSubscriber; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\Process\ProcessBuilder; class PhraseanetIndexerJob extends AbstractJob diff --git a/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php b/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php index e0e65f7ab3..099b2a31c2 100644 --- a/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php +++ b/lib/Alchemy/Phrasea/TaskManager/LiveInformation.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager; use Alchemy\Phrasea\TaskManager\Notifier; use Alchemy\Phrasea\TaskManager\TaskManagerStatus; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class LiveInformation { diff --git a/lib/Alchemy/Phrasea/TaskManager/Log/LogFilefactory.php b/lib/Alchemy/Phrasea/TaskManager/Log/LogFilefactory.php index c52ab97c09..c7bf86bff5 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Log/LogFilefactory.php +++ b/lib/Alchemy/Phrasea/TaskManager/Log/LogFilefactory.php @@ -11,7 +11,7 @@ namespace Alchemy\Phrasea\TaskManager\Log; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class LogFileFactory { diff --git a/lib/Alchemy/Phrasea/TaskManager/Log/TaskLogFile.php b/lib/Alchemy/Phrasea/TaskManager/Log/TaskLogFile.php index 884515f415..f1b68ad684 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Log/TaskLogFile.php +++ b/lib/Alchemy/Phrasea/TaskManager/Log/TaskLogFile.php @@ -11,7 +11,7 @@ namespace Alchemy\Phrasea\TaskManager\Log; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskLogFile extends AbstractLogFile implements LogFileInterface { diff --git a/lib/Alchemy/Phrasea/TaskManager/Task.php b/lib/Alchemy/Phrasea/TaskManager/Task.php index 4b68cc6f72..7daf045e88 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Task.php +++ b/lib/Alchemy/Phrasea/TaskManager/Task.php @@ -11,7 +11,7 @@ namespace Alchemy\Phrasea\TaskManager; -use Entities\Task as TaskEntity; +use Alchemy\Phrasea\Model\Entities\Task as TaskEntity; use Alchemy\TaskManager\TaskInterface; use Symfony\Component\Process\Process; diff --git a/lib/Alchemy/Phrasea/TaskManager/TaskList.php b/lib/Alchemy/Phrasea/TaskManager/TaskList.php index 4380f7ffa5..766f31b235 100644 --- a/lib/Alchemy/Phrasea/TaskManager/TaskList.php +++ b/lib/Alchemy/Phrasea/TaskManager/TaskList.php @@ -11,10 +11,10 @@ namespace Alchemy\Phrasea\TaskManager; +use Alchemy\Phrasea\Model\Entities\Task as TaskEntity; +use Alchemy\Phrasea\Model\Repositories\TaskRepository; use Alchemy\TaskManager\TaskListInterface; use Symfony\Component\Process\ProcessBuilder; -use Entities\Task as TaskEntity; -use Repositories\TaskRepository; class TaskList implements TaskListInterface { diff --git a/lib/classes/patch/370a8.php b/lib/classes/patch/370a8.php index 782f18cd69..6d70fc321a 100644 --- a/lib/classes/patch/370a8.php +++ b/lib/classes/patch/370a8.php @@ -10,8 +10,7 @@ */ use Alchemy\Phrasea\Application; - -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; /** * diff --git a/lib/classes/patch/3908.php b/lib/classes/patch/3908.php index 100ae92715..a258ceab05 100644 --- a/lib/classes/patch/3908.php +++ b/lib/classes/patch/3908.php @@ -10,7 +10,7 @@ */ use Alchemy\Phrasea\Application; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class patch_3908 implements patchInterface { diff --git a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php index 93e4455f76..e5663b212c 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php +++ b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php @@ -6,7 +6,7 @@ use Alchemy\Phrasea\Border\File; use Alchemy\Phrasea\Border\Manager; use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Authentication\Context; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\HttpKernel\Client; use Symfony\Component\HttpFoundation\Response; diff --git a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskRunTest.php b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskRunTest.php index 03115dbd8a..707df9300a 100644 --- a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskRunTest.php +++ b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskRunTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task; use Alchemy\Phrasea\Command\Task\TaskRun; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskRunTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStartTest.php b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStartTest.php index 1620de5dcd..afe8d8421b 100644 --- a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStartTest.php +++ b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStartTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task; use Alchemy\Phrasea\Command\Task\TaskStart; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskStartTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStateTest.php b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStateTest.php index 2305cd4ce1..ce2948a030 100644 --- a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStateTest.php +++ b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStateTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task; use Alchemy\Phrasea\Command\Task\TaskState; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskStateTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStopTest.php b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStopTest.php index 7ecea98864..355b9a4c89 100644 --- a/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStopTest.php +++ b/tests/Alchemy/Tests/Phrasea/Command/Task/TaskStopTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\Command\Task; use Alchemy\Phrasea\Command\Task\TaskStop; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskStopTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php index 2c25143b39..2091a743b9 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/AdminCollectionTest.php @@ -563,7 +563,7 @@ class AdminCollectionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $json = $this->getJson(self::$DI['client']->getResponse()); $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'); } } diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php index c7a4eb4728..3b88c28bd4 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/DataboxTest.php @@ -682,7 +682,7 @@ class DataboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $json = $this->getJson(self::$DI['client']->getResponse()); $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'); } diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Admin/TaskManagerTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Admin/TaskManagerTest.php index df2f100341..cda670d294 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Admin/TaskManagerTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Admin/TaskManagerTest.php @@ -2,7 +2,7 @@ namespace Alchemy\Tests\Phrasea\Controller\Admin; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Symfony\Component\HttpFoundation\Response; class TaskManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract @@ -109,7 +109,7 @@ class TaskManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(302, self::$DI['client']->getResponse()->getStatusCode()); $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() diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Converter/TaskConverterTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Converter/TaskConverterTest.php index 8b5e329f14..70f03b51fe 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Converter/TaskConverterTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Converter/TaskConverterTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Phrasea\Controller\Converter; use Alchemy\Phrasea\Controller\Converter\TaskConverter; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskConverterTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/Model/Manipulator/TaskManipulatorTest.php b/tests/Alchemy/Tests/Phrasea/Model/Manipulator/TaskManipulatorTest.php index 937242769b..7c1aac12f2 100644 --- a/tests/Alchemy/Tests/Phrasea/Model/Manipulator/TaskManipulatorTest.php +++ b/tests/Alchemy/Tests/Phrasea/Model/Manipulator/TaskManipulatorTest.php @@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\Model\Manipulator; use Alchemy\Phrasea\Model\Manipulator\TaskManipulator; use Alchemy\Phrasea\TaskManager\Notifier; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract { @@ -104,7 +104,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract public function testGetRepository() { $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() @@ -119,7 +119,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract $manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock()); $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(array($task), $tasks); $settings = simplexml_load_string($task->getSettings()); @@ -127,7 +127,7 @@ class TaskManipulatorTest extends \PhraseanetPHPUnitAbstract } 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() diff --git a/tests/Doctrine/Tests/Repositories/TaskRepositoryTest.php b/tests/Alchemy/Tests/Phrasea/Model/Repositories/TaskRepositoryTest.php similarity index 82% rename from tests/Doctrine/Tests/Repositories/TaskRepositoryTest.php rename to tests/Alchemy/Tests/Phrasea/Model/Repositories/TaskRepositoryTest.php index 8e95b02607..49be417b6d 100644 --- a/tests/Doctrine/Tests/Repositories/TaskRepositoryTest.php +++ b/tests/Alchemy/Tests/Phrasea/Model/Repositories/TaskRepositoryTest.php @@ -1,8 +1,8 @@ persist($task2); 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()); $task1->setStatus(Task::STATUS_STARTED); diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Event/FinishedJobRemoverSubscriberTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Event/FinishedJobRemoverSubscriberTest.php index 4eedccda50..d90dd4db27 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Event/FinishedJobRemoverSubscriberTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Event/FinishedJobRemoverSubscriberTest.php @@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Event; use Alchemy\Phrasea\TaskManager\Event\FinishedJobRemoverSubscriber; use Alchemy\Phrasea\TaskManager\Event\JobFinishedEvent; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class FinishedJobRemoverSubscriberTest extends \PhraseanetPHPUnitAbstract { @@ -21,6 +21,6 @@ class FinishedJobRemoverSubscriberTest extends \PhraseanetPHPUnitAbstract $subscriber = new FinishedJobRemoverSubscriber(self::$DI['app']['EM']); $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)); } } diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Event/JobFinishedEventTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Event/JobFinishedEventTest.php index ce0b75f499..b5b8db5e13 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Event/JobFinishedEventTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Event/JobFinishedEventTest.php @@ -8,7 +8,7 @@ class JobFinishedEventTest extends \PHPUnit_Framework_TestCase { public function testEvent() { - $task = $this->getMock('Entities\Task'); + $task = $this->getMock('Alchemy\Phrasea\Model\Entities\Task'); $event = new JobFinishedEvent($task); $this->assertSame($task, $event->getTask()); } diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/JobDataTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/JobDataTest.php index 27c5c79b73..cfe0d0b6d9 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/JobDataTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/JobDataTest.php @@ -11,7 +11,7 @@ class JobDataTest extends \PHPUnit_Framework_TestCase $app = $this->getMockBuilder('Alchemy\Phrasea\Application') ->disableOriginalConstructor() ->getMock(); - $task = $this->getMockBuilder('Entities\Task') + $task = $this->getMockBuilder('Alchemy\Phrasea\Model\Entities\Task') ->disableOriginalConstructor() ->getMock(); $data = new JobData($app, $task); diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/SubdefsJobTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/SubdefsJobTest.php index 92ede6db12..fd46263c66 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/SubdefsJobTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/SubdefsJobTest.php @@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Job; use Alchemy\Phrasea\TaskManager\Job\SubdefsJob; use Alchemy\Phrasea\TaskManager\Job\JobData; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class SubdefsJobTest extends JobTestCase { @@ -12,7 +12,7 @@ class SubdefsJobTest extends JobTestCase { return new SubdefsJob(); } - + public function doTestRun() { $job = $this->getJob(); diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/WriteMetadataJobTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/WriteMetadataJobTest.php index 483d964177..89e59c6a6f 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Job/WriteMetadataJobTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Job/WriteMetadataJobTest.php @@ -4,7 +4,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Job; use Alchemy\Phrasea\TaskManager\Job\WriteMetadataJob; use Alchemy\Phrasea\TaskManager\Job\JobData; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class WriteMetadataJobTest extends JobTestCase { @@ -12,7 +12,7 @@ class WriteMetadataJobTest extends JobTestCase { return new WriteMetadataJob(); } - + public function doTestRun() { $job = $this->getJob(); diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/LiveInformationTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/LiveInformationTest.php index f3d0b5256d..d400ec1f16 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/LiveInformationTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/LiveInformationTest.php @@ -5,7 +5,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager; use Alchemy\Phrasea\TaskManager\LiveInformation; use Alchemy\Phrasea\TaskManager\Notifier; use Alchemy\Phrasea\TaskManager\TaskManagerStatus; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class LiveInformationTest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Log/LogFileFactoryTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Log/LogFileFactoryTest.php index e3e12696d5..0583b7e71d 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Log/LogFileFactoryTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Log/LogFileFactoryTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Log; use Alchemy\Phrasea\TaskManager\Log\LogFileFactory; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class LogFilefactorytest extends \PhraseanetPHPUnitAbstract { diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/Log/TaskLogFileTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/Log/TaskLogFileTest.php index c50efe9440..630008f32d 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/Log/TaskLogFileTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/Log/TaskLogFileTest.php @@ -3,7 +3,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager\Log; use Alchemy\Phrasea\TaskManager\Log\TaskLogFile; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; class TaskLogFileTest extends LogFileTestCase { diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/TaskListTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/TaskListTest.php index 6d2e4b8dd5..a59b7de51f 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/TaskListTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/TaskListTest.php @@ -2,7 +2,7 @@ namespace Alchemy\Tests\Phrasea\TaskManager; -use Entities\Task; +use Alchemy\Phrasea\Model\Entities\Task; use Alchemy\Phrasea\TaskManager\TaskList; class TaskListTest extends \PhraseanetPHPUnitAbstract @@ -42,7 +42,7 @@ class TaskListTest extends \PhraseanetPHPUnitAbstract self::$DI['app']['EM']->persist($task2); 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() diff --git a/tests/Alchemy/Tests/Phrasea/TaskManager/TaskTest.php b/tests/Alchemy/Tests/Phrasea/TaskManager/TaskTest.php index 00f4adb98c..29e08f4358 100644 --- a/tests/Alchemy/Tests/Phrasea/TaskManager/TaskTest.php +++ b/tests/Alchemy/Tests/Phrasea/TaskManager/TaskTest.php @@ -12,7 +12,7 @@ class TaskTest extends TaskTestCase $process = $this->getMockBuilder('Symfony\Component\Process\Process') ->disableOriginalConstructor() ->getMock(); - $taskEntity = $this->getMock('Entities\Task'); + $taskEntity = $this->getMock('Alchemy\Phrasea\Model\Entities\Task'); $task = new Task($taskEntity, 'task number', 42, $process); $created1 = $task->createProcess(); @@ -32,7 +32,7 @@ class TaskTest extends TaskTestCase $process = $this->getMockBuilder('Symfony\Component\Process\Process') ->disableOriginalConstructor() ->getMock(); - $taskEntity = $this->getMock('Entities\Task'); + $taskEntity = $this->getMock('Alchemy\Phrasea\Model\Entities\Task'); return new Task($taskEntity, 'task number', 42, $process); }