function MigrateSqlIdMapTest::testGetMigrationPluginManagerDeprecation

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetMigrationPluginManagerDeprecation()

Tests deprecation message from Sql::getMigrationPluginManager().

@group legacy

File

core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php, line 1227

Class

MigrateSqlIdMapTest
Tests the SQL ID map plugin.

Namespace

Drupal\Tests\migrate\Unit

Code

public function testGetMigrationPluginManagerDeprecation() : void {
    $container = new ContainerBuilder();
    $migration_plugin_manager = $this->createMock(MigrationPluginManager::class);
    $container->set('plugin.manager.migration', $migration_plugin_manager);
    \Drupal::setContainer($container);
    $this->expectDeprecation('Drupal\\migrate\\Plugin\\migrate\\id_map\\Sql::getMigrationPluginManager() is deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. Use $this->migrationPluginManager instead. See https://www.drupal.org/node/3277306');
    $id_map = $this->getIdMap();
    $id_map->getMigrationPluginManager();
}

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