public function MigrateTestCase::queryResultTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/tests/src/Unit/MigrateTestCase.php \Drupal\Tests\migrate\Unit\MigrateTestCase::queryResultTest()
Tests a query
Parameters
array|\Traversable: The countable. foreach-able actual results if a query is being run.
5 calls to MigrateTestCase::queryResultTest()
- MigrateSqlIdMapTest::testGetRowsNeedingUpdate in core/modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php 
- Tests the getRowsNeedingUpdate method for rows that need an update.
- MigrateSqlIdMapTest::testPrepareUpdate in core/modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php 
- Tests prepareUpdate().
- MigrateSqlIdMapTest::testSaveIdMapping in core/modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php 
- Tests the ID mapping method.
- MigrateSqlIdMapTest::testSetUpdate in core/modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php 
- Tests setting a row source_row_status to STATUS_NEEDS_UPDATE.
- MigrateSqlSourceTestCase::testRetrieval in core/modules/ migrate/ tests/ src/ Unit/ MigrateSqlSourceTestCase.php 
- Test the source returns the same rows as expected.
File
- core/modules/ migrate/ tests/ src/ Unit/ MigrateTestCase.php, line 157 
- Contains \Drupal\Tests\migrate\Unit\MigrateTestCase.
Class
- MigrateTestCase
- Provides setup and helper methods for Migrate module tests.
Namespace
Drupal\Tests\migrate\UnitCode
public function queryResultTest($iter, $expected_results) {
  $this
    ->assertSame(count($expected_results), count($iter), 'Number of results match');
  $count = 0;
  foreach ($iter as $data_row) {
    $expected_row = $expected_results[$count];
    $count++;
    foreach ($expected_row as $key => $expected_value) {
      $this
        ->retrievalAssertHelper($expected_value, $this
        ->getValue($data_row, $key), sprintf('Value matches for key "%s"', $key));
    }
  }
  $this
    ->assertSame(count($expected_results), $count);
}