Commit 2ef89a6a authored by alexpott's avatar alexpott

Issue #2335345 by tstoeckler: Fixed Entity\Migration::getProcessPlugins() can...

Issue #2335345 by tstoeckler: Fixed Entity\Migration::getProcessPlugins() can return NULL but should always return an array.
parent c67e5198
...@@ -214,6 +214,7 @@ public function getProcessPlugins(array $process = NULL) { ...@@ -214,6 +214,7 @@ public function getProcessPlugins(array $process = NULL) {
} }
$index = serialize($process); $index = serialize($process);
if (!isset($this->processPlugins[$index])) { if (!isset($this->processPlugins[$index])) {
$this->processPlugins[$index] = array();
foreach ($this->getProcessNormalized($process) as $property => $configurations) { foreach ($this->getProcessNormalized($process) as $property => $configurations) {
$this->processPlugins[$index][$property] = array(); $this->processPlugins[$index][$property] = array();
foreach ($configurations as $configuration) { foreach ($configurations as $configuration) {
......
<?php
/**
* @file
* Contains \Drupal\Tests\migrate\Unit\Entity\MigrationTest.
*/
namespace Drupal\Tests\migrate\Unit\Entity;
use Drupal\migrate\Entity\Migration;
use Drupal\Tests\UnitTestCase;
/**
* Tests the migrate entity.
*
* @coversDefaultClass \Drupal\migrate\Entity\Migration
*/
class MigrationTest extends UnitTestCase {
/**
* Tests Migration::getProcessPlugins()
*
* @covers ::getProcessPlugins()
*/
public function testGetProcessPlugins() {
$migration = new Migration([], 'migration');
$this->assertEquals([], $migration->getProcessPlugins([]));
}
}
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