Version 1
[yaffs-website] / web / core / modules / migrate / tests / src / Kernel / Plugin / LogTest.php
1 <?php
2
3 namespace Drupal\Tests\migrate\Kernel\Plugin;
4
5 use Drupal\KernelTests\KernelTestBase;
6 use Drupal\migrate\MigrateExecutableInterface;
7 use Drupal\migrate\Row;
8
9 /**
10  * Tests the Log process plugin.
11  *
12  * @group migrate
13  */
14 class LogTest extends KernelTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = ['migrate'];
20
21   /**
22    * Test the Log plugin.
23    */
24   public function testLog() {
25     $plugin = \Drupal::service('plugin.manager.migrate.process')
26       ->createInstance('log');
27     $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal();
28     $row = new Row();
29     $log_message = "Testing the log message";
30
31     // Ensure the log is getting saved.
32     $saved_message = $plugin->transform($log_message, $executable, $row, 'buffalo');
33     $this->assertSame($log_message, $saved_message);
34   }
35
36 }