Ejemplo n.º 1
0
 public function testGetJobIdReturnsAvalidId()
 {
     $dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $logger = $this->getMock('Psr\\Log\\LoggerInterface');
     $factory = new Factory($dispatcher, $logger, $this->createTranslatorMock());
     $job = $this->getJob();
     $this->assertEquals(get_class($job), get_class($factory->create($job->getJobId())));
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \Alchemy\Phrasea\Exception\InvalidArgumentException
  * @expectedExceptionMessage Job `I\Dont\Know\This\Class` not found.
  */
 public function testWithNonExistentClass()
 {
     $factory = new Factory($this->createDispatcherMock(), $this->createLoggerMock(), $this->createTranslatorMock());
     $factory->create('I\\Dont\\Know\\This\\Class');
 }