From 80fc8ab6ec8b52795d0bd743f8b113f793dc8267 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 22:33:22 +0200 Subject: [PATCH] More complete test for escape pgsql --- test/phpunit/CodingSqlTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index d72dc879742..23ffa2f26ed 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -171,11 +171,17 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $db=$this->savdb; if ($db->type == 'mysqli') { - $a = 'abc"\'def'; + $a = 'abc"\'def'; // string is abc"'def print $a; - $result = $db->escape($a); // $result must be abc\"\'def with mysql + $result = $db->escape($a); // $result must be abc\"\'def $this->assertEquals('abc\"\\\'def', $result); } + if ($db->type == 'pgsql') { + $a = 'abc"\'def'; // string is abc"'def + print $a; + $result = $db->escape($a); // $result must be abc"''def + $this->assertEquals('abc"\'\'def', $result); + } } /**