function MigrationTest::testMigrationDependenciesWithInvalidConfig
Same name in other branches
- 9 core/modules/migrate/tests/src/Unit/MigrationTest.php \Drupal\Tests\migrate\Unit\MigrationTest::testMigrationDependenciesWithInvalidConfig()
- 8.9.x core/modules/migrate/tests/src/Unit/MigrationTest.php \Drupal\Tests\migrate\Unit\MigrationTest::testMigrationDependenciesWithInvalidConfig()
- 10 core/modules/migrate/tests/src/Unit/MigrationTest.php \Drupal\Tests\migrate\Unit\MigrationTest::testMigrationDependenciesWithInvalidConfig()
Tests that getting migration dependencies fails with invalid configuration.
@covers ::getMigrationDependencies
@dataProvider getInvalidMigrationDependenciesProvider
@group legacy
Parameters
array $dependencies: An array of migration dependencies.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ MigrationTest.php, line 192
Class
- MigrationTest
- @coversDefaultClass \Drupal\migrate\Plugin\Migration
Namespace
Drupal\Tests\migrate\UnitCode
public function testMigrationDependenciesWithInvalidConfig(array $dependencies) : void {
$migration = new TestMigration();
// Set the plugin ID to test the returned message.
$plugin_id = 'test_migration';
$migration->setPluginId($plugin_id);
// Migration dependencies expects ['optional' => []] or ['required' => []]].
$migration->set('migration_dependencies', $dependencies);
$this->expectException(InvalidPluginDefinitionException::class);
$this->expectExceptionMessage("Invalid migration dependencies configuration for migration {$plugin_id}");
$migration->getMigrationDependencies();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.