ba4a52308cbd10ff2eccf28764644af3034ea6df
[yaffs-website] / vendor / drush / drush / tests / BatchTest.php
1 <?php
2
3 namespace Unish;
4
5 /**
6  * Tests the Drush Batch subsystem.
7  *
8  * @group base
9  */
10 class BatchCase extends CommandUnishTestCase
11 {
12
13     public function testBatch()
14     {
15         $sites = $this->setUpDrupal(1, true);
16         $options = [
17         'include' => __DIR__,
18         ];
19         $this->drush('unit-batch', [], $options);
20         // Collect log messages that begin with "!!!" (@see: _drushUnitBatchOperation())
21         $parsed = $this->parseBackendOutput($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 }