Example #1
0
 /**
  * @covers \Qutee\Worker::run
  * @covers \Qutee\Worker::_runTask
  * @expectedException \InvalidArgumentException
  */
 public function testCallingRunThrowsExceptionIfTaskCanNotRun()
 {
     $priority = Task::PRIORITY_LOW;
     $task = $this->getMock('\\Qutee\\Task', array('getClassName'));
     $task->expects($this->once())->method('getClassName')->will($this->returnValue('UnknownClass'));
     $queue = $this->getMock('\\Qutee\\Queue', array('getTask'));
     $queue->expects($this->once())->method('getTask')->with($priority)->will($this->returnValue($task));
     $this->object->setPriority($priority);
     $this->object->run();
 }