diff -u b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php --- b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php @@ -313,7 +313,6 @@ $module_handler->invokeAll('migrate_' . $migration->id() . '_prepare_row', [$row, $source, $migration]) ->willReturn([TRUE, TRUE]) ->shouldBeCalled(); - $source->setModuleHandler($module_handler->reveal()); $this->idMap->expects($this->once()) ->method('saveIdMapping') only in patch2: unchanged: --- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php +++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php @@ -7,6 +7,8 @@ namespace Drupal\Tests\migrate_drupal\Unit\source\d6; +use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Tests\migrate\Unit\MigrateTestCase; /** @@ -68,11 +70,13 @@ class Drupal6SqlBaseTest extends MigrateTestCase { */ protected function setUp() { $plugin = 'placeholder_id'; + $module_handler = $this->getMock(ModuleHandlerInterface::class); + $cache = $this->getMock(CacheBackendInterface::class); /** @var \Drupal\Core\State\StateInterface $state */ $state = $this->getMock('Drupal\Core\State\StateInterface'); /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); - $this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, array(), $this->getMigration(), $state, $entity_manager); + $this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, array(), $this->getMigration(), $module_handler, $cache, $state, $entity_manager); $this->base->setDatabase($this->getDatabase($this->databaseContents)); } @@ -180,18 +184,6 @@ public function setDatabase(Connection $database) { } /** - * Tweaks Drupal6SqlBase to set a new module handler for tests. - * - * @param \Drupal\Core\Extension\ModuleHandlerInterface - * The new module handler to use. - * - * @see \Drupal\Tests\migrate\Unit\MigrateSqlTestCase - */ - public function setModuleHandler(ModuleHandlerInterface $module_handler) { - $this->moduleHandler = $module_handler; - } - - /** * Wrapper method to test protected method moduleExists(). */ public function moduleExistsWrapper($module) {