From 443f5190dbc60c31e4b67c73daddc5911bf862e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Apr 2023 04:19:53 +0200 Subject: [PATCH] Fix phpunit --- test/phpunit/CodingSqlTest.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 504203eeabf..d72dc879742 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -170,10 +170,12 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $a = 'abc"\'def'; - print $a; - $result = $db->escape($a); // $result must be abc\"\'def - $this->assertEquals('abc\"\\\'def', $result); + if ($db->type == 'mysqli') { + $a = 'abc"\'def'; + print $a; + $result = $db->escape($a); // $result must be abc\"\'def with mysql + $this->assertEquals('abc\"\\\'def', $result); + } } /** @@ -191,7 +193,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase $a = 'abc"\'def_ghi%klm\\nop'; //print $a; - $result = $db->escapeforlike($a); // $result must be abc"'def\_ghi\%klm\\nop + $result = $db->escapeforlike($a); // $result must be abc"'def\_ghi\%klm\\nop with mysql $this->assertEquals('abc"\'def\_ghi\%klm\\\\nop', $result); }