X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/275f3b26560a44099dff762776277812ef0f122f..abf4dbd9505e9701f75c405c7ba1b3e3f1ecbd14:/test/php/Nominatim/DebugTest.php?ds=sidebyside diff --git a/test/php/Nominatim/DebugTest.php b/test/php/Nominatim/DebugTest.php index 7ed08122..7ef1dba3 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() { - $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'); } @@ -179,19 +183,19 @@ EOT // header are taken from first group item, thus no key3 gets printed $aGroups = array( - 'group1' => array( - array('key1' => 'val1', 'key2' => 'val2'), - array('key1' => 'one', 'key2' => 'two', 'unknown' => 1), - ), - 'group2' => array( - array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'), - ) - ); + 'group1' => array( + array('key1' => 'val1', 'key2' => 'val2'), + array('key1' => 'one', 'key2' => 'two', 'unknown' => 1), + ), + 'group2' => array( + array('key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3'), + ) + ); Debug::printGroupTable('Table3', $aGroups); $aGroups = array( - 'group1' => array($this->oWithDebuginfo, $this->oWithDebuginfo), - ); + 'group1' => array($this->oWithDebuginfo, $this->oWithDebuginfo), + ); Debug::printGroupTable('Table4', $aGroups); } }