X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1f887a6ca0aba36261c443a9077eb28725838f7c..b133f2bc4cd5e467ff6ef10124416b1307cfdb62:/test/php/Nominatim/AddressDetailsTest.php diff --git a/test/php/Nominatim/AddressDetailsTest.php b/test/php/Nominatim/AddressDetailsTest.php index 62faf1a4..32f4f457 100644 --- a/test/php/Nominatim/AddressDetailsTest.php +++ b/test/php/Nominatim/AddressDetailsTest.php @@ -2,18 +2,14 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/AddressDetails.php'); +require_once(CONST_LibDir.'/init-website.php'); +require_once(CONST_LibDir.'/AddressDetails.php'); -function chksql($oSql, $sMsg = 'Database request failed') -{ - return $oSql; -} - class AddressDetailsTest extends \PHPUnit\Framework\TestCase { - protected function setUp() + protected function setUp(): void { // How the fixture got created // @@ -34,7 +30,7 @@ class AddressDetailsTest extends \PHPUnit\Framework\TestCase // // 5) copy&paste into file. Add commas between records // - $json = file_get_contents(CONST_BasePath.'/test/php/fixtures/address_details_10_downing_street.json'); + $json = file_get_contents(CONST_DataDir.'/test/php/fixtures/address_details_10_downing_street.json'); $data = json_decode($json, true); $this->oDbStub = $this->getMockBuilder(\DB::class) @@ -74,7 +70,7 @@ class AddressDetailsTest extends \PHPUnit\Framework\TestCase { $oAD = new AddressDetails($this->oDbStub, 194663412, 10, 'en'); $expected = array( - 'attraction' => '10 Downing Street', + 'tourism' => '10 Downing Street', 'house_number' => '10', 'road' => 'Downing Street', 'neighbourhood' => 'St. James\'s',