3 namespace Drupal\Tests\migrate\Unit\process;
5 use Drupal\Core\Entity\EntityStorageInterface;
6 use Drupal\Core\Menu\MenuLinkManagerInterface;
7 use Drupal\migrate\MigrateSkipRowException;
8 use Drupal\migrate\Plugin\migrate\process\MenuLinkParent;
9 use Drupal\migrate\Plugin\MigrateProcessInterface;
12 * Tests the menu link parent process plugin.
14 * @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MenuLinkParent
17 class MenuLinkParentTest extends MigrateProcessTestCase {
22 protected function setUp() {
24 $migration_plugin = $this->prophesize(MigrateProcessInterface::class);
25 $menu_link_manager = $this->prophesize(MenuLinkManagerInterface::class);
26 $menu_link_storage = $this->prophesize(EntityStorageInterface::class);
27 $this->plugin = new MenuLinkParent([], 'map', [], $migration_plugin->reveal(), $menu_link_manager->reveal(), $menu_link_storage->reveal());
33 public function testTransformException() {
34 $this->setExpectedException(MigrateSkipRowException::class, "No parent link found for plid '1' in menu 'admin'.");
35 $this->plugin->transform([1, 'admin', NULL], $this->migrateExecutable, $this->row, 'destinationproperty');