summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2016-06-18 13:37:45 (GMT)
committerAlex Pott2016-06-18 13:37:45 (GMT)
commit9bb1c3691c257f1a89c7545da9f1ec2aaa7c4dc9 (patch)
treeb0e4cd971d6f333d2ffc23cba37cc966c0b8f74b
parent788d8077e0bee62df6dce432a45970d94a4147bf (diff)
Issue #2723123 by agoradesign, milesw: Last imported timestamps not set in map tables
-rw-r--r--core/modules/migrate/src/Plugin/Migration.php4
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php25
2 files changed, 27 insertions, 2 deletions
diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php
index 3b666a4..abad54f 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 35c4da7..83bf24d 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());
+ }
+
}