You are here

public function MenuLinkParentTest::testTransformException in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php \Drupal\Tests\migrate\Unit\process\MenuLinkParentTest::testTransformException()

@covers ::transform

File

core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php, line 71

Class

MenuLinkParentTest
Tests the menu link parent process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testTransformException() {
  $plugin = new MenuLinkParent([], 'map', [], $this->migrateLookup
    ->reveal(), $this->menuLinkManager
    ->reveal(), $this->menuLinkStorage
    ->reveal(), $this->migration
    ->reveal());
  $this
    ->expectException(MigrateSkipRowException::class);
  $this
    ->expectExceptionMessage("No parent link found for plid '1' in menu 'admin'.");
  $plugin
    ->transform([
    1,
    'admin',
    NULL,
  ], $this->migrateExecutable, $this->row, 'destination_property');
}