Fix latest rebase

This commit is contained in:
Romain Neutron
2013-10-29 18:56:01 +01:00
parent c5d6491001
commit 5d2dd07caa
40 changed files with 61 additions and 61 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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);
});
}

View File

@@ -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',
));
}

View File

@@ -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
{

View File

@@ -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');
}
}

View File

@@ -1,9 +1,9 @@
<?php
namespace Repositories;
namespace Alchemy\Phrasea\Model\Repositories;
use Alchemy\Phrasea\Model\Entities\Task;
use Doctrine\ORM\EntityRepository;
use Entities\Task;
/**
* TaskRepository

View File

@@ -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

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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

View File

@@ -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
{

View File

@@ -11,7 +11,7 @@
namespace Alchemy\Phrasea\TaskManager\Log;
use Entities\Task;
use Alchemy\Phrasea\Model\Entities\Task;
class LogFileFactory
{

View File

@@ -11,7 +11,7 @@
namespace Alchemy\Phrasea\TaskManager\Log;
use Entities\Task;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskLogFile extends AbstractLogFile implements LogFileInterface
{

View File

@@ -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;

View File

@@ -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
{

View File

@@ -10,8 +10,7 @@
*/
use Alchemy\Phrasea\Application;
use Entities\Task;
use Alchemy\Phrasea\Model\Entities\Task;
/**
*

View File

@@ -10,7 +10,7 @@
*/
use Alchemy\Phrasea\Application;
use Entities\Task;
use Alchemy\Phrasea\Model\Entities\Task;
class patch_3908 implements patchInterface
{

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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');
}
}

View File

@@ -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');
}

View File

@@ -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()

View File

@@ -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
{

View File

@@ -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()

View File

@@ -1,8 +1,8 @@
<?php
namespace Doctrine\Tests\Repositories;
namespace Alchemy\Tests\Phrasea\Model\Repositories;
use Entities\Task;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskRepositoryTest extends \PhraseanetPHPUnitAbstract
{
@@ -23,7 +23,7 @@ class TaskRepositoryTest extends \PhraseanetPHPUnitAbstract
self::$DI['app']['EM']->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);

View File

@@ -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));
}
}

View File

@@ -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());
}

View File

@@ -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);

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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()

View File

@@ -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);
}