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