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 @@ -10,6 +10,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Drupal\migrate\MigrateExecutable; use Drupal\migrate\MigrateSkipRowException; use Drupal\migrate\Plugin\migrate\source\SourcePluginBase; @@ -89,9 +90,12 @@ ->method('getRowBySource') ->willReturn($id_map_array); - $constructor_args = [$configuration, 'd6_action', [], $this->migration]; + // Mock a key-value store for getting the high water value. + $high_water_storage = $this->getMock(KeyValueStoreInterface::class); + + $constructor_args = [$configuration, 'd6_action', [], $this->migration, $high_water_storage]; $methods = ['getModuleHandler', 'fields', 'getIds', '__toString', 'getIterator', 'prepareRow', 'initializeIterator', 'calculateDependencies', 'getHighWater']; - $source_plugin = $this->getMock('\Drupal\migrate\Plugin\migrate\source\SourcePluginBase', $methods, $constructor_args); + $source_plugin = $this->getMock(SourcePluginBase::class, $methods, $constructor_args); $source_plugin ->expects($this->any()) only in patch2: unchanged: --- a/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php +++ b/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php @@ -1,6 +1,8 @@ dataRows = $configuration['data_rows']; $this->ids = $configuration['ids']; } only in patch2: unchanged: --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php @@ -4,6 +4,7 @@ use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Core\Entity\DependencyTrait; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\migrate\source\EmptySource as BaseEmptySource; @@ -32,8 +33,8 @@ class EmptySource extends BaseEmptySource implements ContainerFactoryPluginInter /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityManagerInterface $entity_manager) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); + public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, KeyValueStoreInterface $high_water_storage, EntityManagerInterface $entity_manager) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $high_water_storage); $this->entityManager = $entity_manager; } @@ -46,6 +47,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $migration, + $container->get('keyvalue')->get('migrate:high_water'), $container->get('entity.manager') ); } 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,7 @@ namespace Drupal\Tests\migrate_drupal\Unit\source\d6; +use Drupal\Core\KeyValueStore\KeyValueStoreInterface; use Drupal\Tests\migrate\Unit\MigrateTestCase; /** @@ -72,7 +73,8 @@ protected function setUp() { $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); + $high_water_storage = $this->getMock(KeyValueStoreInterface::class); + $this->base = new TestDrupal6SqlBase($this->migrationConfiguration, $plugin, array(), $this->getMigration(), $high_water_storage, $state, $entity_manager); $this->base->setDatabase($this->getDatabase($this->databaseContents)); }