]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/AddressDetailsTest.php
adding prefix to keys is now more configurable
[nominatim.git] / test / php / Nominatim / AddressDetailsTest.php
index 62faf1a4b2d7caa27b0dd9cbcc819d65f2dc0457..1425be2d4f6305c5ec9a9d5c372e5fa6dba4570e 100644 (file)
@@ -1,19 +1,23 @@
 <?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;
 
-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
 {
 
 class AddressDetailsTest extends \PHPUnit\Framework\TestCase
 {
 
-    protected function setUp()
+    protected function setUp(): void
     {
         // How the fixture got created
         //
     {
         // How the fixture got created
         //
@@ -34,7 +38,7 @@ class AddressDetailsTest extends \PHPUnit\Framework\TestCase
         //
         // 5) copy&paste into file. Add commas between records
         //
         //
         // 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)
         $data = json_decode($json, true);
 
         $this->oDbStub = $this->getMockBuilder(\DB::class)
@@ -74,7 +78,7 @@ class AddressDetailsTest extends \PHPUnit\Framework\TestCase
     {
         $oAD = new AddressDetails($this->oDbStub, 194663412, 10, 'en');
         $expected = array(
     {
         $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',
                      'house_number' => '10',
                      'road' => 'Downing Street',
                      'neighbourhood' => 'St. James\'s',