function LogTest::testLog

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

Tests the Log plugin.

@dataProvider providerTestLog()

File

core/modules/migrate/tests/src/Unit/process/LogTest.php, line 20

Class

LogTest
Tests the Log process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testLog($value, $expected_message) {
    // Test the expected log message.
    $this->migrateExecutable
        ->expects($this->once())
        ->method('saveMessage')
        ->with($expected_message);
    $plugin = new Log([], 'log', []);
    // Test the input value is not altered.
    $new_value = $plugin->transform($value, $this->migrateExecutable, new Row(), 'foo');
    $this->assertSame($value, $new_value);
}

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