public function MigrationPluginManagerTest::dependencyProvider in Drupal 9
Same name and namespace in other branches
- 8 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 71
Class
- MigrationPluginManagerTest
- @coversDefaultClass \Drupal\migrate\Plugin\MigrationPluginManager @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
public function dependencyProvider() {
return [
// Just one migration, with no dependencies.
[
[
'm1' => [
'dependencies' => [],
'result_requirements' => [],
],
],
[
'm1',
],
],
// Just one migration, with required dependencies.
[
[
'm1' => [
'dependencies' => [
'required' => [
'required1',
'required2',
],
],
'result_requirements' => [
'required1',
'required2',
],
],
],
[
'm1',
],
],
// Just one migration, with optional dependencies.
[
[
'm1' => [
'dependencies' => [
'optional' => [
'optional1',
],
],
'result_requirements' => [],
],
],
[
'm1',
],
],
// Multiple migrations.
[
[
'm1' => [
'dependencies' => [
'required' => [
'required1',
'required2',
],
],
'result_requirements' => [
'required1',
'required2',
],
],
'm2' => [
'dependencies' => [
'optional' => [
'optional1',
],
],
'result_requirements' => [],
],
],
[
'm1',
'm2',
],
],
// Multiple migrations, reordered due to optional requirement.
[
[
'm1' => [
'dependencies' => [
'optional' => [
'm2',
],
],
'result_requirements' => [],
],
'm2' => [
'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' => [
'dependencies' => [
'optional' => [
'm2',
],
],
'result_requirements' => [],
],
'm2' => [
'dependencies' => [],
'result_requirements' => [],
],
],
[
'm2',
'm1',
],
],
];
}