batchTest.php

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

Namespace

Unish

Classes

Namesort descending Description
batchCase Tests the drush batch subsystem.

File

tests/batchTest.php
View source
  1. <?php
  2. namespace Unish;
  3. /**
  4. * Tests the drush batch subsystem.
  5. *
  6. * @see includes/batch.inc
  7. *
  8. * @group base
  9. */
  10. class batchCase extends CommandUnishTestCase {
  11. public function testBatch() {
  12. $sites = $this->setUpDrupal(1, TRUE);
  13. $options = array(
  14. 'root' => $this->webroot(),
  15. 'uri' => key($sites),
  16. 'yes' => NULL,
  17. 'include' => dirname(__FILE__),
  18. );
  19. $this->drush('unit-batch', array(), $options);
  20. // Collect log messages that begin with "!!!" (@see: _drush_unit_batch_operation())
  21. $parsed = $this->parse_backend_output($this->getOutput());
  22. $special_log_msgs = '';
  23. foreach ($parsed['log'] as $key => $log) {
  24. if(substr($log['message'],0,3) == '!!!') {
  25. $special_log_msgs .= $log['message'];
  26. }
  27. }
  28. $this->assertEquals("!!! ArrayObject does its job.", $special_log_msgs, 'Batch messages were logged');
  29. }
  30. }