protected function StubSourceGeneratorPlugin::initializeIterator in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/MigrateSourceTest.php \Drupal\Tests\migrate\Unit\StubSourceGeneratorPlugin::initializeIterator()
Initializes the iterator with the source data.
Return value
\Iterator Returns an iterable object of data for this source.
Overrides StubSourcePlugin::initializeIterator
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateSourceTest.php, line 547 - Contains \Drupal\Tests\migrate\Unit\MigrateSourceTest.
Class
- StubSourceGeneratorPlugin
- Stubbed source plugin with a generator as iterator. Also it overwrites the $skipCount, $cacheCounts and $trackChanges properties.
Namespace
Drupal\Tests\migrate\UnitCode
protected function initializeIterator() {
$data = [
[
'title' => 'foo',
],
[
'title' => 'bar',
],
[
'title' => 'iggy',
],
];
foreach ($data as $row) {
(yield $row);
}
}