queueTest.php

  1. 8.0.x tests/queueTest.php
  2. 6.x tests/queueTest.php
  3. 7.x tests/queueTest.php
  4. 5.x tests/queueTest.php
  5. master tests/queueTest.php

Classes

Namesort ascending Description
QueueCase

File

tests/queueTest.php
View source
  1. <?php
  2. /*
  3. * @file
  4. * Tests for queue commands.
  5. *
  6. * @group commands
  7. */
  8. class QueueCase extends Drush_CommandTestCase {
  9. function testQueue() {
  10. $sites = $this->setUpDrupal(1, TRUE);
  11. $options = array(
  12. 'yes' => NULL,
  13. 'root' => $this->webroot(),
  14. 'uri' => key($sites),
  15. );
  16. // Enable aggregator since it declares a queue.
  17. $this->drush('en', array('aggregator'), $options);
  18. $this->drush('queue-list', array(), $options);
  19. $output = $this->getOutput();
  20. $this->assertContains('aggregator_feeds', $output, 'Queue list shows the declared queue.');
  21. $this->drush('php-script', array('queue_script'), $options + array('script-path' => dirname(__FILE__) . '/resources'));
  22. $this->drush('queue-list', array(), $options + array('pipe' => TRUE));
  23. $output = trim($this->getOutput());
  24. $parts = explode(",", $output);
  25. $this->assertEquals('aggregator_feeds,1,SystemQueue', $output, 'Item was successfully added to the queue.');
  26. $output = $this->getOutput();
  27. $this->drush('queue-run', array('aggregator_feeds'), $options);
  28. $this->drush('queue-list', array(), $options + array('pipe' => TRUE));
  29. $output = trim($this->getOutput());
  30. $parts = explode(",", $output);
  31. $this->assertEquals('aggregator_feeds,0,SystemQueue', $output, 'Queue item processed.');
  32. }
  33. }