function MigrationTest::testMigrationDependenciesInConstructor

Same name in other branches
  1. 11.x core/modules/migrate/tests/src/Unit/MigrationTest.php \Drupal\Tests\migrate\Unit\MigrationTest::testMigrationDependenciesInConstructor()

Tests checking migration dependencies in the constructor.

@covers ::__construct

@dataProvider getInvalidMigrationDependenciesProvider

@group legacy

Parameters

array $dependencies: An array of migration dependencies.

File

core/modules/migrate/tests/src/Unit/MigrationTest.php, line 39

Class

MigrationTest
@coversDefaultClass \Drupal\migrate\Plugin\Migration

Namespace

Drupal\Tests\migrate\Unit

Code

public function testMigrationDependenciesInConstructor(array $dependencies) : void {
    $configuration = [
        'migration_dependencies' => $dependencies,
    ];
    $plugin_id = 'test_migration';
    $migration_plugin_manager = $this->createMock('\\Drupal\\migrate\\Plugin\\MigrationPluginManagerInterface');
    $source_plugin_manager = $this->createMock('\\Drupal\\migrate\\Plugin\\MigratePluginManagerInterface');
    $process_plugin_manager = $this->createMock('\\Drupal\\migrate\\Plugin\\MigratePluginManagerInterface');
    $destination_plugin_manager = $this->createMock('\\Drupal\\migrate\\Plugin\\MigrateDestinationPluginManager');
    $id_map_plugin_manager = $this->createMock('\\Drupal\\migrate\\Plugin\\MigratePluginManagerInterface');
    $this->expectDeprecation("Invalid migration dependencies for {$plugin_id} is deprecated in drupal:10.1.0 and will cause an error in drupal:11.0.0. See https://www.drupal.org/node/3266691");
    new Migration($configuration, $plugin_id, [], $migration_plugin_manager, $source_plugin_manager, $process_plugin_manager, $destination_plugin_manager, $id_map_plugin_manager);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.