Skip to content
Snippets Groups Projects
Unverified Commit b9fdef83 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2959106 by rakesh.gectcr, Jo Fitzgerald, quietone, heddn: Log message...

Issue #2959106 by rakesh.gectcr, Jo Fitzgerald, quietone, heddn: Log message if menu_link_parent plugin skip the row
parent 72d0bff4
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -97,7 +97,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
}
}
}
throw new MigrateSkipRowException();
throw new MigrateSkipRowException(sprintf("No parent link found for plid '%d' in menu '%s'.", $parent_id, $value[0]));
}
}
<?php
namespace Drupal\Tests\migrate\Unit\process;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Menu\MenuLinkManagerInterface;
use Drupal\migrate\MigrateSkipRowException;
use Drupal\migrate\Plugin\migrate\process\MenuLinkParent;
use Drupal\migrate\Plugin\MigrateProcessInterface;
/**
* Tests the menu link parent process plugin.
*
* @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MenuLinkParent
* @group migrate
*/
class MenuLinkParentTest extends MigrateProcessTestCase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$migration_plugin = $this->prophesize(MigrateProcessInterface::class);
$menu_link_manager = $this->prophesize(MenuLinkManagerInterface::class);
$menu_link_storage = $this->prophesize(EntityStorageInterface::class);
$this->plugin = new MenuLinkParent([], 'map', [], $migration_plugin->reveal(), $menu_link_manager->reveal(), $menu_link_storage->reveal());
}
/**
* @covers ::transform
*/
public function testTransformException() {
$this->setExpectedException(MigrateSkipRowException::class, "No parent link found for plid '1' in menu 'admin'.");
$this->plugin->transform([1, 'admin', NULL], $this->migrateExecutable, $this->row, 'destinationproperty');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment