function LogTest::testLog

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/LogTest.php \Drupal\Tests\migrate\Unit\process\LogTest::testLog()
  2. 9 core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php \Drupal\Tests\migrate\Kernel\Plugin\LogTest::testLog()
  3. 10 core/modules/migrate/tests/src/Unit/process/LogTest.php \Drupal\Tests\migrate\Unit\process\LogTest::testLog()
  4. 10 core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php \Drupal\Tests\migrate\Kernel\Plugin\LogTest::testLog()
  5. 11.x core/modules/migrate/tests/src/Unit/process/LogTest.php \Drupal\Tests\migrate\Unit\process\LogTest::testLog()
  6. 11.x core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php \Drupal\Tests\migrate\Kernel\Plugin\LogTest::testLog()

Test the Log plugin.

File

core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php, line 24

Class

LogTest
Tests the Log process plugin.

Namespace

Drupal\Tests\migrate\Kernel\Plugin

Code

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.