You are here

public function EventBaseTest::testGetMigration in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php \Drupal\Tests\migrate\Unit\Event\EventBaseTest::testGetMigration()

Tests getMigration method.

@covers ::__construct @covers ::getMigration

File

core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php, line 20

Class

EventBaseTest
@coversDefaultClass \Drupal\migrate\Event\EventBase @group migrate

Namespace

Drupal\Tests\migrate\Unit\Event

Code

public function testGetMigration() {
  $migration = $this
    ->prophesize('\\Drupal\\migrate\\Plugin\\MigrationInterface')
    ->reveal();
  $message_service = $this
    ->prophesize('\\Drupal\\migrate\\MigrateMessageInterface')
    ->reveal();
  $row = $this
    ->prophesize('\\Drupal\\migrate\\Row')
    ->reveal();
  $event = new EventBase($migration, $message_service, $row, [
    1,
    2,
    3,
  ]);
  $this
    ->assertSame($migration, $event
    ->getMigration());
}