]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/DebugTest.php
add tests for details result formatting and trim results
[nominatim.git] / test / php / Nominatim / DebugTest.php
index 9db7557e1a12186eb80c30d900903899a2d41f1b..dbce890f4ce3ea9477b32d9f8e5c769eb3ac7f97 100644 (file)
@@ -1,20 +1,32 @@
 <?php
 <?php
+/**
+ * SPDX-License-Identifier: GPL-2.0-only
+ *
+ * This file is part of Nominatim. (https://nominatim.org)
+ *
+ * Copyright (C) 2022 by the Nominatim developer community.
+ * For a full list of authors see the git log.
+ */
 
 namespace Nominatim;
 
 
 namespace Nominatim;
 
-use Exception;
-
-require_once('../../lib/DebugHtml.php');
+require_once(CONST_LibDir.'/DebugHtml.php');
 
 class DebugTest extends \PHPUnit\Framework\TestCase
 {
 
 class DebugTest extends \PHPUnit\Framework\TestCase
 {
-    protected function setUp()
+
+    protected function setUp(): void
     {
     {
-        $this->oWithDebuginfo = $this->getMock(Geocode::class, array('debugInfo'));
+        $this->oWithDebuginfo = $this->getMockBuilder(\GeococdeMock::class)
+                                    ->setMethods(array('debugInfo'))
+                                    ->getMock();
         $this->oWithDebuginfo->method('debugInfo')
                   ->willReturn(array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'));
 
         $this->oWithDebuginfo->method('debugInfo')
                   ->willReturn(array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'));
 
-        $this->oWithToString = $this->getMock(Geocode::class, array('__toString'));
+
+        $this->oWithToString = $this->getMockBuilder(\SomeMock::class)
+                                    ->setMethods(array('__toString'))
+                                    ->getMock();
         $this->oWithToString->method('__toString')->willReturn('me as string');
     }
 
         $this->oWithToString->method('__toString')->willReturn('me as string');
     }