Same name and namespace in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMapContents()
  2. 9 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMapContents()

Retrieves the contents of an ID map.

Return value

array The contents of an ID map.

4 calls to MigrateSqlIdMapTest::getIdMapContents()
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.

File

core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php, line 1050

Class

MigrateSqlIdMapTest
Tests the SQL ID map plugin.

Namespace

Drupal\Tests\migrate\Unit

Code

private function getIdMapContents() {
  $result = $this->database
    ->select('migrate_map_sql_idmap_test', 't')
    ->fields('t')
    ->execute();

  // The return value needs to be countable, or it will fail certain
  // assertions. iterator_to_array() will not suffice because it won't
  // respect the PDO fetch mode, if specified.
  $contents = [];
  foreach ($result as $row) {
    $contents[] = (array) $row;
  }
  return $contents;
}