Ejemplo n.º 1
0
 /**
  * @covers \Qutee\Task::create
  * @todo This is integrational test, not unit test, remedy!
  */
 public function testCreatingTaskViaStaticMethodAddsTaskToQueue()
 {
     $queue = Queue::factory();
     $this->assertEmpty($queue->getTasks());
     $data = array('test' => 'data');
     Task::create('TestTask', $data, Task::PRIORITY_LOW, 'unq', 'methodName');
     $task = $queue->getTask();
     $this->assertInstanceOf('\\Qutee\\Task', $task);
     $this->assertEquals('TestTask', $task->getName());
     $this->assertEquals(Task::PRIORITY_LOW, $task->getPriority());
     $this->assertEquals(md5('TestTaskunq'), $task->getUniqueId());
     $this->assertEquals('methodName', $task->getMethodName());
     $this->assertSame($data, $task->getData());
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     Queue::factory();
     $this->object = new Worker();
     $this->object->setInterval(0.5);
 }
Ejemplo n.º 3
0
 /**
  * @covers \Qutee\Queue::get
  */
 public function testGettingQueueBehavesAsSingleton()
 {
     $queue = Queue::factory();
     $this->assertSame($queue, Queue::get());
 }