function MigrateMessageTest::testMessagesTeed

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php \Drupal\Tests\migrate\Kernel\MigrateMessageTest::testMessagesTeed()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php \Drupal\Tests\migrate\Kernel\MigrateMessageTest::testMessagesTeed()
  3. 10 core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php \Drupal\Tests\migrate\Kernel\MigrateMessageTest::testMessagesTeed()

Tests migration interruptions.

File

core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php, line 90

Class

MigrateMessageTest
Tests whether idmap messages are sent to message interface when requested.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testMessagesTeed() : void {
    // Ask to receive any messages sent to the idmap.
    \Drupal::service('event_dispatcher')->addListener(MigrateEvents::IDMAP_MESSAGE, [
        $this,
        'mapMessageRecorder',
    ]);
    $executable = new MigrateExecutable($this->migration, $this);
    $executable->import();
    $this->assertCount(1, $this->messages);
    $id = $this->migration
        ->getPluginId();
    $this->assertSame("source_message: {$id}:message:concat: 'a message' is not an array", reset($this->messages));
}

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