You are here

public function MigrateMessageTest::testMessagesTeed in Drupal 8

Same name and namespace in other branches
  1. 9 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() {

  // 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);
  $this
    ->assertIdentical(reset($this->messages), "source_message: 'a message' is not an array");
}