MigratePostRowSaveEventTest.php

Same filename in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php
  2. 10 core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php
  3. 11.x core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php

Namespace

Drupal\Tests\migrate\Unit\Event

File

core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php

View source
<?php

namespace Drupal\Tests\migrate\Unit\Event;

use Drupal\migrate\Event\MigratePostRowSaveEvent;

/**
 * @coversDefaultClass \Drupal\migrate\Event\MigratePostRowSaveEvent
 * @group migrate
 */
class MigratePostRowSaveEventTest extends EventBaseTest {
    
    /**
     * Tests getDestinationIdValues method.
     *
     * @covers ::__construct
     * @covers ::getDestinationIdValues
     */
    public function testGetDestinationIdValues() {
        $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 MigratePostRowSaveEvent($migration, $message_service, $row, [
            1,
            2,
            3,
        ]);
        $this->assertSame([
            1,
            2,
            3,
        ], $event->getDestinationIdValues());
    }
    
    /**
     * Tests getRow method.
     *
     * @covers ::__construct
     * @covers ::getRow
     */
    public function testGetRow() {
        $migration = $this->prophesize('\\Drupal\\migrate\\Plugin\\MigrationInterface')
            ->reveal();
        $message_service = $this->prophesize('\\Drupal\\migrate\\MigrateMessageInterface');
        $row = $this->prophesize('\\Drupal\\migrate\\Row')
            ->reveal();
        $event = new MigratePostRowSaveEvent($migration, $message_service->reveal(), $row, [
            1,
            2,
            3,
        ]);
        $this->assertSame($row, $event->getRow());
    }

}

Classes

Title Deprecated Summary
MigratePostRowSaveEventTest @coversDefaultClass \Drupal\migrate\Event\MigratePostRowSaveEvent @group migrate

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