Unverified Commit 9d04cb49 authored by alexpott's avatar alexpott

Issue #2937045 by quietone, heddn: source plugin source_module testing seems incomplete

parent 19d0533f
......@@ -19,7 +19,8 @@
* elements, with values of 'user' and 'image', respectively.
*
* @MigrateSource(
* id = "empty"
* id = "empty",
* source_module = "migrate"
* )
*/
class EmptySource extends SourcePluginBase {
......
......@@ -31,16 +31,12 @@ public function testSourceProvider() {
public function testProvidersExist() {
$this->enableAllModules();
/** @var \Drupal\migrate\Plugin\MigrationPluginManager $plugin_manager */
$plugin_manager = $this->container->get('plugin.manager.migration');
/** @var \Drupal\migrate\Plugin\MigrateSourcePluginManager $plugin_manager */
$plugin_manager = $this->container->get('plugin.manager.migrate.source');
// Instantiate all migrations.
$migrations = array_keys($plugin_manager->getDefinitions());
$migrations = $plugin_manager->createInstances($migrations);
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
foreach ($migrations as $migration) {
$this->assertInternalType('string', $migration->getSourcePlugin()->getSourceModule());
foreach ($plugin_manager->getDefinitions() as $definition) {
$id = $definition['id'];
$this->assertArrayHasKey('source_module', $definition, "No source_module property in '$id'");
}
}
......
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