Exemplo n.º 1
0
 public function testCreateEmptyCollection()
 {
     $collection = $this->getMockBuilder('collection')->disableOriginalConstructor()->getMock();
     $collection->expects($this->once())->method('get_base_id')->will($this->returnValue(42));
     $task = $this->sut->createEmptyCollectionJob($collection);
     $tasks = $this->findAllTasks();
     $this->assertSame('EmptyCollection', $task->getJobId());
     $this->assertContains($task, $tasks);
     $settings = simplexml_load_string($task->getSettings());
     $this->assertEquals(42, (int) $settings->bas_id);
 }
Exemplo n.º 2
0
 public function testCreateEmptyCollection()
 {
     $collection = $this->getMockBuilder('collection')->disableOriginalConstructor()->getMock();
     $collection->expects($this->once())->method('get_base_id')->will($this->returnValue(42));
     $manipulator = new TaskManipulator(self::$DI['app']['EM'], $this->createNotifierMock(), self::$DI['app']['translator'], self::$DI['app']['repo.tasks']);
     $task = $manipulator->createEmptyCollectionJob($collection);
     $tasks = self::$DI['app']['EM']->getRepository('Phraseanet:Task')->findAll();
     $this->assertSame('EmptyCollection', $task->getJobId());
     $this->assertContains($task, $tasks);
     $settings = simplexml_load_string($task->getSettings());
     $this->assertEquals(42, (int) $settings->bas_id);
 }