Merge pull request #1754 from mtmail/nominatim-db-tests-against-postgres

Nominatim::DB tests against separate postgresql database
This commit is contained in:
Sarah Hoffmann
2020-04-26 10:20:30 +02:00
committed by GitHub
5 changed files with 194 additions and 9 deletions

View File

@@ -85,7 +85,7 @@ class SetupFunctions
info('Create DB');
$oDB = new \Nominatim\DB;
if ($oDB->databaseExists()) {
if ($oDB->checkConnection()) {
fail('database already exists ('.CONST_Database_DSN.')');
}
@@ -675,7 +675,7 @@ class SetupFunctions
);
$aDropTables = array();
$aHaveTables = $this->oDB->getCol("SELECT tablename FROM pg_tables WHERE schemaname='public'");
$aHaveTables = $this->oDB->getListOfTables();
foreach ($aHaveTables as $sTable) {
$bFound = false;
@@ -870,7 +870,7 @@ class SetupFunctions
private function dropTable($sName)
{
if ($this->bVerbose) echo "Dropping table $sName\n";
$this->oDB->exec('DROP TABLE IF EXISTS '.$sName.' CASCADE');
$this->oDB->deleteTable($sName);
}
/**