Skip to content
Snippets Groups Projects
Commit 975c1642 authored by catch's avatar catch
Browse files

Issue #2504417 by alexpott: Fix...

Issue #2504417 by alexpott: Fix Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetQualifiedMapTablePrefix()
parent 5e6c61d4
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -7,6 +7,7 @@
namespace Drupal\Tests\migrate\Unit;
use Drupal\Core\Database\Driver\sqlite\Connection;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\MigrateException;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
......@@ -742,18 +743,18 @@ public function testDestroy() {
* Tests the getQualifiedMapTable method with a prefixed database.
*/
public function testGetQualifiedMapTablePrefix() {
$this->database = $this->getDatabase([], ['database' => 'source_database', 'prefix' => 'prefix']);
$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\Core\Database\Driver\sqlite\Connection::__construct()
if ($this->database->driver() == 'sqlite') {
$this->assertEquals('prefix.migrate_map_sql_idmap_test', $qualified_map_table);
}
else {
$this->assertEquals('source_database.prefixmigrate_map_sql_idmap_test', $qualified_map_table);
}
}
/**
* Tests all the iterator methods in one swing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment