X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9454761cca4bb3a2b0fa997797054d67078a2fcc..09935d41484d5e9ec450bb16170785849029f3da:/test/php/Nominatim/LibTest.php diff --git a/test/php/Nominatim/LibTest.php b/test/php/Nominatim/LibTest.php index 533188ad..d2237b60 100644 --- a/test/php/Nominatim/LibTest.php +++ b/test/php/Nominatim/LibTest.php @@ -2,13 +2,13 @@ namespace Nominatim; -require_once '../../lib/lib.php'; +require_once(CONST_BasePath.'/lib/ClassTypes.php'); -class LibTest extends \PHPUnit_Framework_TestCase +class LibTest extends \PHPUnit\Framework\TestCase { public function testGetClassTypesWithImportance() { - $aClasses = getClassTypesWithImportance(); + $aClasses = ClassTypes\getListWithImportance(); $this->assertGreaterThan( 200, @@ -31,22 +31,22 @@ class LibTest extends \PHPUnit_Framework_TestCase public function testGetResultDiameter() { - $aResult = array(); + $aResult = array('class' => '', 'type' => ''); $this->assertEquals( 0.0001, - getResultDiameter($aResult) + ClassTypes\getProperty($aResult, 'defdiameter', 0.0001) ); $aResult = array('class' => 'place', 'type' => 'country'); $this->assertEquals( 15, - getResultDiameter($aResult) + ClassTypes\getProperty($aResult, 'defdiameter', 0.0001) ); $aResult = array('class' => 'boundary', 'type' => 'administrative', 'admin_level' => 6); $this->assertEquals( 0.32, - getResultDiameter($aResult) + ClassTypes\getProperty($aResult, 'defdiameter', 0.0001) ); }