You are here

private function SmartSqlTest::getIdMapContents in Smart SQL ID Map 1.1.x

Same name and namespace in other branches
  1. 1.0.x tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php \Drupal\Tests\smart_sql_idmap\Unit\Plugin\migrate\id_map\SmartSqlTest::getIdMapContents()

Retrieves the contents of an ID map.

Return value

array The contents of an ID map.

Overrides MigrateSqlIdMapTest::getIdMapContents

4 calls to SmartSqlTest::getIdMapContents()
SmartSqlTest::testGetRowsNeedingUpdate in tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php
Tests the getRowsNeedingUpdate method for rows that need an update.
SmartSqlTest::testPrepareUpdate in tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php
Tests prepareUpdate().
SmartSqlTest::testSaveIdMapping in tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php
Tests the ID mapping method.
SmartSqlTest::testSetUpdate in tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php
Tests setting a row source_row_status to STATUS_NEEDS_UPDATE.

File

tests/src/Unit/Plugin/migrate/id_map/SmartSqlTest.php, line 453

Class

SmartSqlTest
Tests the Smart SQL ID map plugin.

Namespace

Drupal\Tests\smart_sql_idmap\Unit\Plugin\migrate\id_map

Code

private function getIdMapContents() {
  $result = $this->database
    ->select($this
    ->getIdMap()
    ->getQualifiedMapTableName(), '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;
}