Version 1
[yaffs-website] / web / core / modules / migrate / tests / src / Kernel / Plugin / LogTest.php
diff --git a/web/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php b/web/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
new file mode 100644 (file)
index 0000000..bb5d04d
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests\migrate\Kernel\Plugin;
+
+use Drupal\KernelTests\KernelTestBase;
+use Drupal\migrate\MigrateExecutableInterface;
+use Drupal\migrate\Row;
+
+/**
+ * Tests the Log process plugin.
+ *
+ * @group migrate
+ */
+class LogTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['migrate'];
+
+  /**
+   * Test the Log plugin.
+   */
+  public function testLog() {
+    $plugin = \Drupal::service('plugin.manager.migrate.process')
+      ->createInstance('log');
+    $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal();
+    $row = new Row();
+    $log_message = "Testing the log message";
+
+    // Ensure the log is getting saved.
+    $saved_message = $plugin->transform($log_message, $executable, $row, 'buffalo');
+    $this->assertSame($log_message, $saved_message);
+  }
+
+}