diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php index 3b666a4d7ae6..abad54f4d01b 100644 --- a/core/modules/migrate/src/Plugin/Migration.php +++ b/core/modules/migrate/src/Plugin/Migration.php @@ -703,14 +703,14 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn * {@inheritdoc} */ public function getTrackLastImported() { - $this->trackLastImported; + return $this->trackLastImported; } /** * {@inheritdoc} */ public function getDestinationIds() { - $this->destinationIds; + return $this->destinationIds; } } diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php index 35c4da7e056a..83bf24dff536 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php @@ -39,4 +39,29 @@ class MigrationTest extends KernelTestBase { $this->assertNotEmpty($migration->getMigrationDependencies(), 'Migration dependencies is not empty'); } + /** + * Tests Migration::getDestinationIds() + * + * @covers ::getDestinationIds + */ + public function testGetDestinationIds() { + $migration = \Drupal::service('plugin.manager.migration')->createStubMigration(['destinationIds' => ['foo' => 'bar']]); + $destination_ids = $migration->getDestinationIds(); + $this->assertNotEmpty($destination_ids, 'Destination ids are not empty'); + $this->assertEquals(['foo' => 'bar'], $destination_ids, 'Destination ids match the expected values.'); + } + + /** + * Tests Migration::getTrackLastImported() + * + * @covers ::getTrackLastImported + * @covers ::isTrackLastImported + */ + public function testGetTrackLastImported() { + $migration = \Drupal::service('plugin.manager.migration')->createStubMigration([]); + $migration->setTrackLastImported(TRUE); + $this->assertEquals(TRUE, $migration->getTrackLastImported()); + $this->assertEquals(TRUE, $migration->isTrackLastImported()); + } + }