Commit e2289f20 authored by catch's avatar catch

Issue #3189064 by Matroskeen, quietone, benjifisher: Migration sql source...

Issue #3189064 by Matroskeen, quietone, benjifisher: Migration sql source plugins can not be serialised because of reference to the database connection
parent 32d88bfa
......@@ -461,4 +461,11 @@ protected function mapJoinable() {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function __sleep() {
return array_diff(parent::__sleep(), ['database']);
}
}
......@@ -146,6 +146,15 @@ public function testGetDefinitions() {
}
Database::addConnectionInfo('migrate', 'default', $connection_info['default']);
// Make sure source plugins can be serialized.
foreach ($migration_plugins as $migration_plugin) {
$source_plugin = $migration_plugin->getSourcePlugin();
if ($source_plugin instanceof SqlBase) {
$source_plugin->getDatabase();
}
$this->assertNotEmpty(serialize($source_plugin));
}
$migration_plugins = $this->container->get('plugin.manager.migration')->getDefinitions();
// All the plugins provided by core depend on migrate_drupal.
$this->assertNotEmpty($migration_plugins);
......
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