Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / tests / BatchTest.php
diff --git a/vendor/drush/drush/tests/BatchTest.php b/vendor/drush/drush/tests/BatchTest.php
new file mode 100644 (file)
index 0000000..ba4a523
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Unish;
+
+/**
+ * Tests the Drush Batch subsystem.
+ *
+ * @group base
+ */
+class BatchCase extends CommandUnishTestCase
+{
+
+    public function testBatch()
+    {
+        $sites = $this->setUpDrupal(1, true);
+        $options = [
+        'include' => __DIR__,
+        ];
+        $this->drush('unit-batch', [], $options);
+        // Collect log messages that begin with "!!!" (@see: _drushUnitBatchOperation())
+        $parsed = $this->parseBackendOutput($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');
+    }
+}