Пример #1
0
 /**
  * Test loading of the task
  * 
  * @return void
  * 
  * @test
  */
 public function testLoadTask()
 {
     //generate a random value to verify
     $_testValue = mt_rand();
     //create a task and check it's instantiated
     $_task = $this->_helper->createTask('test', array('test' => $_testValue));
     $this->assertInstanceOf('Lilmuckers_Queue_Model_Queue_Task', $_task, 'Check that the task object was instantiated');
     //ensure the store ID on the task is correct
     $this->assertEquals($_task->getStore()->getId(), Mage::app()->getStore()->getId(), 'Check that the store view id is set to the task');
     //ensure the data that was set is okay
     $this->assertEquals($_testValue, $_task->getTest());
 }
Пример #2
0
 /**
  * Create a task for testing with
  * 
  * @param int    $randomFactor A random factor to add to the task data
  * @param string $task         The task to flag
  * 
  * @return Lilmuckers_Queue_Model_Queue_Task
  */
 protected function _getTask($randomFactor = self::DEFAULT_TASK_DATA, $task = 'test')
 {
     return $this->_helper->createTask($task, array('test' => $randomFactor));
 }
 /**
  * Create a task for testing with
  * 
  * @param int $randomFactor a random factor to add to the task data
  * 
  * @return Lilmuckers_Queue_Model_Queue_Task
  */
 protected function _getTask($randomFactor)
 {
     return $this->_helper->createTask('test', array('test' => $randomFactor));
 }