From 22941f5ad15c42b43f1180120591e4a02f0d86ea Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 5 Dec 2018 12:07:45 -0500 Subject: [PATCH] Fix session tests PostgreSQL now passes all tests. Connection and permission errors still need to be accounted for before the implementation is complete. --- tests/cases/Database/Base.php | 5 ++++- tests/phpunit.xml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cases/Database/Base.php b/tests/cases/Database/Base.php index 46ce64e..428b80c 100644 --- a/tests/cases/Database/Base.php +++ b/tests/cases/Database/Base.php @@ -134,7 +134,10 @@ abstract class Base extends \JKingWeb\Arsse\Test\AbstractTest{ public function compareExpectations(array $expected): bool { foreach ($expected as $table => $info) { - $cols = implode(",", array_keys($info['columns'])); + $cols = array_map(function($v) { + return '"'.str_replace('"', '""', $v).'"'; + }, array_keys($info['columns'])); + $cols = implode(",", $cols); $types = $info['columns']; $data = static::$drv->prepare("SELECT $cols from $table")->run()->getAll(); $cols = array_keys($info['columns']); diff --git a/tests/phpunit.xml b/tests/phpunit.xml index d496410..29fe5e4 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -66,7 +66,7 @@ cases/Db/SQLite3/TestDatabase.php cases/Db/SQLite3PDO/TestDatabase.php - + cases/Db/PostgreSQL/TestDatabase.php cases/REST/TestTarget.php