You are here

public function MigrateSourceTest::testNewHighwater in Zircon Profile 8

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

Test that a highwater mark newer than our saved one imports a row.

Throws

\Exception

File

core/modules/migrate/tests/src/Unit/MigrateSourceTest.php, line 221
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 testNewHighwater() {

  // Set a highwater property field for source. Now we should have a row
  // because the row timestamp is greater than the current highwater mark.
  $source = $this
    ->getSource([], [
    'highWaterProperty' => [
      'name' => 'timestamp',
    ],
  ], MigrateIdMapInterface::STATUS_IMPORTED);
  $source
    ->rewind();
  $this
    ->assertTrue(is_a($source
    ->current(), 'Drupal\\migrate\\Row'), 'Incoming row timestamp is greater than current highwater mark so we have a row.');
}