]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/AddressDetailsTest.php
add `state_code` field to response address details
[nominatim.git] / test / php / Nominatim / AddressDetailsTest.php
index 4678911cdd5ec1e09255f581fb64416edb949ae3..4cf363448b3e8fd50ec126ea4635528d054485b9 100644 (file)
@@ -1,9 +1,17 @@
 <?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;
 
-require_once(CONST_BasePath.'/lib/init-website.php');
-require_once(CONST_BasePath.'/lib/AddressDetails.php');
+require_once(CONST_LibDir.'/init-website.php');
+require_once(CONST_LibDir.'/AddressDetails.php');
 
 
 class AddressDetailsTest extends \PHPUnit\Framework\TestCase
@@ -30,7 +38,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)
@@ -78,6 +86,7 @@ class AddressDetailsTest extends \PHPUnit\Framework\TestCase
                      'city' => 'London',
                      'state_district' => 'Greater London',
                      'state' => 'England',
+                     'state_code' => 'ENG',
                      'postcode' => 'SW1A 2AA',
                      'country' => 'United Kingdom',
                      'country_code' => 'gb'