Unverified Commit b2f170c5 authored by alexpott's avatar alexpott
Browse files

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

Issue #2959097 by Jo Fitzgerald, rakesh.gectcr, quietone, heddn: Log message if migration plugin skip the row When there is no destination found.
parent bbac45a7
......@@ -410,7 +410,7 @@ protected function getProcessNormalized(array $process) {
*/
public function getDestinationPlugin($stub_being_requested = FALSE) {
if ($stub_being_requested && !empty($this->destination['no_stub'])) {
throw new MigrateSkipRowException();
throw new MigrateSkipRowException('Stub requested but not made because no_stub configuration is set.');
}
if (!isset($this->destinationPlugin)) {
$this->destinationPlugin = $this->destinationPluginManager->createInstance($this->destination['plugin'], $this->destination, $this);
......
......@@ -4,6 +4,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateSkipRowException;
/**
* Tests the migration plugin.
......@@ -115,4 +116,15 @@ public function testGetTrackLastImported() {
$this->assertEquals(TRUE, $migration->isTrackLastImported());
}
/**
* Tests Migration::getDestinationPlugin()
*
* @covers ::getDestinationPlugin
*/
public function testGetDestinationPlugin() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration(['destination' => ['no_stub' => TRUE]]);
$this->setExpectedException(MigrateSkipRowException::class, "Stub requested but not made because no_stub configuration is set.");
$migration->getDestinationPlugin(TRUE);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment