You are here

public function MigrateSourceTest::testOutdatedHighwater in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/MigrateSourceTest.php \Drupal\Tests\migrate\Unit\MigrateSourceTest::testOutdatedHighwater()

Test that an outdated highwater mark does not cause a row to be imported.

File

core/modules/migrate/tests/src/Unit/MigrateSourceTest.php, line 249
Contains \Drupal\Tests\migrate\Unit\MigrateSourceTest.

Class

MigrateSourceTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\source\SourcePluginBase @group migrate

Namespace

Drupal\Tests\migrate\Unit

Code

public function testOutdatedHighwater() {
  $configuration = [
    'high_water_property' => [
      'name' => 'timestamp',
    ],
  ];
  $source = $this
    ->getSource($configuration, [], MigrateIdMapInterface::STATUS_IMPORTED, $this->row['timestamp'] + 1);

  // The current highwater mark is now higher than the row timestamp so no row
  // is expected.
  $source
    ->rewind();
  $this
    ->assertNull($source
    ->current(), 'Original highwater mark is higher than incoming row timestamp.');
}