function MigrateSqlIdMapTest::getIdMapContents

Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMapContents()
  2. 10 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMapContents()
  3. 11.x 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 1010

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.