3 namespace Drupal\Tests\migrate\Unit\Event;
5 use Drupal\migrate\Event\MigratePostRowSaveEvent;
8 * @coversDefaultClass \Drupal\migrate\Event\MigratePostRowSaveEvent
11 class MigratePostRowSaveEventTest extends EventBaseTest {
14 * Test getDestinationIdValues method.
16 * @covers ::__construct
17 * @covers ::getDestinationIdValues
19 public function testGetDestinationIdValues() {
20 $migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
21 $message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface')->reveal();
22 $row = $this->prophesize('\Drupal\migrate\Row')->reveal();
23 $event = new MigratePostRowSaveEvent($migration, $message_service, $row, [1, 2, 3]);
24 $this->assertSame([1, 2, 3], $event->getDestinationIdValues());
30 * @covers ::__construct
33 public function testGetRow() {
34 $migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
35 $message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface');
36 $row = $this->prophesize('\Drupal\migrate\Row')->reveal();
37 $event = new MigratePostRowSaveEvent($migration, $message_service->reveal(), $row, [1, 2, 3]);
38 $this->assertSame($row, $event->getRow());