Commit f56e1001 authored by alexpott's avatar alexpott

Issue #2717483 by pguillard, mikeryan: Empty migration_dependencies gives...

Issue #2717483 by pguillard, mikeryan: Empty migration_dependencies gives "Unsupported operand types"
parent fc189a4c
......@@ -662,7 +662,7 @@ public function setTrackLastImported($track_last_imported) {
* {@inheritdoc}
*/
public function getMigrationDependencies() {
return $this->migration_dependencies + ['required' => [], 'optional' => []];
return ($this->migration_dependencies ?: []) + ['required' => [], 'optional' => []];
}
/**
......
......@@ -27,4 +27,16 @@ public function testGetProcessPlugins() {
$this->assertEquals([], $migration->getProcessPlugins([]));
}
/**
* Tests Migration::getMigrationDependencies()
*
* @covers ::getMigrationDependencies
*/
public function testGetMigrationDependencies() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration([
'migration_dependencies' => NULL
]);
$this->assertNotEmpty($migration->getMigrationDependencies(), 'Migration dependencies is not empty');
}
}
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