You are here

public function MigrateSqlIdMapTest::testGetQualifiedMapTablePrefix in Drupal 10

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

Tests the getQualifiedMapTable method with a prefixed database.

File

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

Class

MigrateSqlIdMapTest
Tests the SQL ID map plugin.

Namespace

Drupal\Tests\migrate\Unit

Code

public function testGetQualifiedMapTablePrefix() {
  $connection_options = [
    'database' => ':memory:',
    'prefix' => 'prefix',
  ];
  $pdo = Connection::open($connection_options);
  $this->database = new Connection($pdo, $connection_options);
  $qualified_map_table = $this
    ->getIdMap()
    ->getQualifiedMapTableName();

  // The SQLite driver is a special flower. It will prefix tables with
  // PREFIX.TABLE, instead of the standard PREFIXTABLE.
  // @see \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
  $this
    ->assertEquals('prefix.migrate_map_sql_idmap_test', $qualified_map_table);
}