function MigrateProcessErrorMessagesTest::testProcessErrorMessage

Same name in other branches
  1. 10 core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php \Drupal\Tests\migrate\Kernel\MigrateProcessErrorMessagesTest::testProcessErrorMessage()

Tests format of map messages saved from plugin exceptions.

File

core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php, line 102

Class

MigrateProcessErrorMessagesTest
Tests the format of messages from process plugin exceptions.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testProcessErrorMessage() : void {
    $this->definition['process']['error']['plugin'] = 'test_error';
    $this->idMap
        ->saveMessage([
        'id' => 1,
    ], "process_errors_migration:error:test_error: Process exception.", MigrationInterface::MESSAGE_ERROR)
        ->shouldBeCalled();
    $this->setPluginManagers();
    
    /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
    $migration = \Drupal::service('plugin.manager.migration')->createStubMigration($this->definition);
    $executable = new MigrateExecutable($migration, $this);
    $executable->import();
}

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