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

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

File

core/modules/migrate/tests/src/Unit/MigrateSourceTest.php, line 249

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.');
}