LogTest.php

Same filename in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/LogTest.php
  2. 9 core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
  3. 9 core/tests/Drupal/Tests/Core/Database/LogTest.php
  4. 10 core/modules/migrate/tests/src/Unit/process/LogTest.php
  5. 10 core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
  6. 10 core/tests/Drupal/Tests/Core/Database/LogTest.php
  7. 11.x core/modules/migrate/tests/src/Unit/process/LogTest.php
  8. 11.x core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php

Namespace

Drupal\Tests\migrate\Kernel\Plugin

File

core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php

View source
<?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);
    }

}

Classes

Title Deprecated Summary
LogTest Tests the Log process plugin.

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