function MigrateSourceTest::testNextNeedsUpdate
Tests that $row->needsUpdate() works as expected.
File
- 
              core/modules/ migrate/ tests/ src/ Unit/ MigrateSourceTest.php, line 233 
Class
- MigrateSourceTest
- @coversDefaultClass \Drupal\migrate\Plugin\migrate\source\SourcePluginBase[[api-linebreak]] @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
public function testNextNeedsUpdate() : void {
  $source = $this->getSource();
  // $row->needsUpdate() === TRUE so we get a row.
  $source->rewind();
  $this->assertTrue(is_a($source->current(), 'Drupal\\migrate\\Row'), '$row->needsUpdate() is TRUE so we got a row.');
  // Test that we don't get a row when the incoming row is marked as imported.
  $source = $this->getSource([], [], MigrateIdMapInterface::STATUS_IMPORTED);
  $source->rewind();
  $this->assertNull($source->current(), 'Row was already imported, should be NULL');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
