function MigrationPluginManagerTest::dependencyProvider
Same name in other branches
- 9 core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php \Drupal\Tests\migrate\Unit\MigrationPluginManagerTest::dependencyProvider()
- 8.9.x core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php \Drupal\Tests\migrate\Unit\MigrationPluginManagerTest::dependencyProvider()
- 10 core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php \Drupal\Tests\migrate\Unit\MigrationPluginManagerTest::dependencyProvider()
Provide dependency data for testing.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ MigrationPluginManagerTest.php, line 93
Class
- MigrationPluginManagerTest
- @coversDefaultClass \Drupal\migrate\Plugin\MigrationPluginManager @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
public static function dependencyProvider() {
return [
// Just one migration, with no dependencies.
[
[
'm1' => [
'migration_dependencies' => [],
'result_requirements' => [],
],
],
[
'm1',
],
],
// Just one migration, with required dependencies.
[
[
'm1' => [
'migration_dependencies' => [
'required' => [
'required1',
'required2',
],
],
'result_requirements' => [
'required1',
'required2',
],
],
],
[
'm1',
],
],
// Just one migration, with optional dependencies.
[
[
'm1' => [
'migration_dependencies' => [
'optional' => [
'optional1',
],
],
'result_requirements' => [],
],
],
[
'm1',
],
],
// Multiple migrations.
[
[
'm1' => [
'migration_dependencies' => [
'required' => [
'required1',
'required2',
],
],
'result_requirements' => [
'required1',
'required2',
],
],
'm2' => [
'migration_dependencies' => [
'optional' => [
'optional1',
],
],
'result_requirements' => [],
],
],
[
'm1',
'm2',
],
],
// Multiple migrations, reordered due to optional requirement.
[
[
'm1' => [
'migration_dependencies' => [
'optional' => [
'm2',
],
],
'result_requirements' => [],
],
'm2' => [
'migration_dependencies' => [
'optional' => [
'optional1',
],
],
'result_requirements' => [],
],
],
[
'm2',
'm1',
],
],
// Ensure that optional requirements aren't turned into required ones,
// if the last migration has no optional deps.
[
[
'm1' => [
'migration_dependencies' => [
'optional' => [
'm2',
],
],
'result_requirements' => [],
],
'm2' => [
'migration_dependencies' => [],
'result_requirements' => [],
],
],
[
'm2',
'm1',
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.