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