コード例 #1
0
ファイル: TaskTest.php プロジェクト: anorgan/qutee
 /**
  * @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());
 }
コード例 #2
0
ファイル: WorkerTest.php プロジェクト: anorgan/qutee
 public function setUp()
 {
     Queue::factory();
     $this->object = new Worker();
     $this->object->setInterval(0.5);
 }
コード例 #3
0
ファイル: QueueTest.php プロジェクト: anorgan/qutee
 /**
  * @covers \Qutee\Queue::get
  */
 public function testGettingQueueBehavesAsSingleton()
 {
     $queue = Queue::factory();
     $this->assertSame($queue, Queue::get());
 }