]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/TokenListTest.php
replace database abstraction DB with PDO
[nominatim.git] / test / php / Nominatim / TokenListTest.php
index 4016a839860294eb05bb2167fe002e243453a1b5..417f52c09782dbb35a6f95d890ac2902441e7817 100644 (file)
@@ -56,9 +56,18 @@ class TokenTest extends \PHPUnit\Framework\TestCase
     {
         $this->expectOutputRegex('/<p><tt>/');
 
-        $oDbStub = $this->getMockBuilder(\DB::class)
-                        ->setMethods(array('getAll'))
+        $oDbStub = $this->getMockBuilder(Nominatim\DB::class)
+                        ->setMethods(array('getAll', 'getDBQuotedList'))
                         ->getMock();
+
+        $oDbStub->method('getDBQuotedList')
+                ->will($this->returnCallback(function ($aVals) {
+                    return array_map(function ($sVal) {
+                        return "'".$sVal."'";
+                    }, $aVals);
+                }));
+
+
         $oDbStub->method('getAll')
                 ->will($this->returnCallback(function ($sql) {
                     $aResults = array();