1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Test setting of schema name

This commit is contained in:
J. King 2018-11-27 17:39:39 -05:00
parent 1414f8979c
commit 93af381436
2 changed files with 10 additions and 6 deletions

View file

@ -76,7 +76,8 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
"SET statement_timeout = '$timeout'",
];
if (strlen($schema) > 0) {
$out[] = 'SET search_path = \'"'.str_replace('"', '""', $schema).'", "$user", public\'';
$schema = '"'.str_replace('"', '""', $schema).'"';
$out[] = "SET search_path = $schema, public";
}
return $out;
}
@ -92,11 +93,6 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
}
}
public static function driverName(): string {
return Arsse::$lang->msg("Driver.Db.PostgreSQL.Name");
}
public static function schemaID(): string {
return "PostgreSQL";
}
@ -150,11 +146,18 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
public function __destruct() {
}
/** @codeCoverageIgnore */
public static function driverName(): string {
return Arsse::$lang->msg("Driver.Db.PostgreSQL.Name");
}
/** @codeCoverageIgnore */
public static function requirementsMet(): bool {
// stub: native interface is not yet supported
return false;
}
/** @codeCoverageIgnore */
protected function makeConnection(string $user, string $pass, string $db, string $host, int $port, string $service) {
// stub: native interface is not yet supported
throw new \Exception;

View file

@ -47,6 +47,7 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
'dbPostgreSQLUser' => "arsse_test",
'dbPostgreSQLPass' => "arsse_test",
'dbPostgreSQLDb' => "arsse_test",
'dbPostgreSQLSchema' => "arsse_test",
];
Arsse::$conf = ($force ? null : Arsse::$conf) ?? (new Conf)->import($defaults)->import($conf);
}