Last active
July 28, 2017 12:35
-
-
Save GoZOo/ff615d134deb73692ae91e5c24712e93 to your computer and use it in GitHub Desktop.
In a Drupal 8 PHPunit migration test, iterate on rows. Warning, if migration is previously executed, no iteration will be made.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function testMyMigration() { | |
$migration = $this->getMigration('MY_MIGRATION'); | |
$source = $migration->getSourcePlugin(); | |
$source->initializeIterator(); | |
for ($i=0 ; $i < $source->count(); $i++) { | |
$source->rewind(); | |
$row = $source->current(); | |
$rows[] = $row; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment