X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1d8e2961f0527a548989c1e38bb062f2f9e5877e..dc3b1abfe2d06c790317bb66e51abfd9334e08f8:/test/php/Nominatim/DebugTest.php?ds=sidebyside diff --git a/test/php/Nominatim/DebugTest.php b/test/php/Nominatim/DebugTest.php index 6e0c25f3..5d9525ac 100644 --- a/test/php/Nominatim/DebugTest.php +++ b/test/php/Nominatim/DebugTest.php @@ -2,19 +2,23 @@ namespace Nominatim; -use Exception; +require_once(CONST_BasePath.'/lib/DebugHtml.php'); -require_once('../../lib/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->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'); }