]> git.openstreetmap.org Git - nominatim.git/commitdiff
adapt php tests to new directory constants
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 17 Dec 2020 15:50:52 +0000 (16:50 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 19 Dec 2020 13:33:04 +0000 (14:33 +0100)
14 files changed:
test/php/Nominatim/AddressDetailsTest.php
test/php/Nominatim/ClassTypesTest.php
test/php/Nominatim/DBTest.php
test/php/Nominatim/DatabaseErrorTest.php
test/php/Nominatim/DebugTest.php
test/php/Nominatim/LibTest.php
test/php/Nominatim/OutputTest.php
test/php/Nominatim/ParameterParserTest.php
test/php/Nominatim/PhraseTest.php
test/php/Nominatim/SearchContextTest.php
test/php/Nominatim/ShellTest.php
test/php/Nominatim/StatusTest.php
test/php/Nominatim/TokenListTest.php
test/php/bootstrap.php

index 4678911cdd5ec1e09255f581fb64416edb949ae3..32f4f457d5676048181e0b2d1df2f81c7b96309f 100644 (file)
@@ -2,8 +2,8 @@
 
 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 +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)
index 1ba79bdba282218c4aa448528a95294d27782485..102569542880220ae58380764515fc2ae2027c32 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/ClassTypes.php');
+require_once(CONST_LibDir.'/ClassTypes.php');
 
 class ClassTypesTest extends \PHPUnit\Framework\TestCase
 {
index 1991f6f1e7655d69da15c4096ea237e801ca5b08..8a3157a8b5098e8ef30cbb571fbbff4f094c1f4b 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/lib.php');
-require_once(CONST_BasePath.'/lib/DB.php');
+require_once(CONST_LibDir.'/lib.php');
+require_once(CONST_LibDir.'/DB.php');
 
 // subclassing so we can set the protected connection variable
 class NominatimSubClassedDB extends \Nominatim\DB
index 7b461894f3f9c2efa96637850ed4eee7cb3cae56..da15649347cc73ae293f83b6acbb1037614b4c42 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/init-website.php');
-require_once(CONST_BasePath.'/lib/DatabaseError.php');
+require_once(CONST_LibDir.'/init-website.php');
+require_once(CONST_LibDir.'/DatabaseError.php');
 
 class DatabaseErrorTest extends \PHPUnit\Framework\TestCase
 {
index 5d9525acc0beef2e5da54b90541bd90154d08611..09860914af4830fb348dba8422d8d0262b0e2d59 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/DebugHtml.php');
+require_once(CONST_LibDir.'/DebugHtml.php');
 
 class DebugTest extends \PHPUnit\Framework\TestCase
 {
index 28cd9af04896f4f58a8b59c326534c2fbf5f73b1..6e9038eecdd0d1c741b768572fffd658a916e822 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/lib.php');
-require_once(CONST_BasePath.'/lib/ClassTypes.php');
+require_once(CONST_LibDir.'/lib.php');
+require_once(CONST_LibDir.'/ClassTypes.php');
 
 class LibTest extends \PHPUnit\Framework\TestCase
 {
index b243ba4714621762da534fe8a35f08e822de9fac..cbfebb7d40bc30820179a88ef188873276d3ad65 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/output.php');
+require_once(CONST_LibDir.'/output.php');
 
 class OutputTest extends \PHPUnit\Framework\TestCase
 {
index 361fefc1c8f15ecb35a9255bc537ae3fdc02511f..3b06e2740a74a824a69280e5b42fd9f9909bfe78 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/ParameterParser.php');
+require_once(CONST_LibDir.'/ParameterParser.php');
 
 
 function userError($sError)
index ab031bb0b0cdedfd3bb1b449a77c788f4de45eb3..42166e34f330da72a06f2089e6e99d0a4b73db21 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/Phrase.php');
+require_once(CONST_LibDir.'/Phrase.php');
 
 class TokensFullSet
 {
index 2b575a16c31a464a0eb4ec385a45097feb41320b..1b3462971039f345762c3fa2897df617e8b3a983 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/SearchContext.php');
+require_once(CONST_LibDir.'/SearchContext.php');
 
 class SearchContextTest extends \PHPUnit\Framework\TestCase
 {
index d0222ee1995495644344c77cc907a50bf6cc45cf..2d81b71d95f0c71c8d11a8bddf28c29948729f96 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/Shell.php');
+require_once(CONST_LibDir.'/Shell.php');
 
 class ShellTest extends \PHPUnit\Framework\TestCase
 {
index f45e6633bb9cd831ede5cfba76c51dee4b0293ee..8cb8a703a07f7d186603eb58a6d0862e0b7cf47c 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/DB.php');
-require_once(CONST_BasePath.'/lib/Status.php');
+require_once(CONST_LibDir.'/DB.php');
+require_once(CONST_LibDir.'/Status.php');
 
 
 class StatusTest extends \PHPUnit\Framework\TestCase
index ca43aabb3d71bfa6780d50b24d26aa6f5cbcf81c..3ef4d84d715df5bc4ecc8776a5986190dcff498d 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/TokenList.php');
+require_once(CONST_LibDir.'/TokenList.php');
 
 
 class TokenTest extends \PHPUnit\Framework\TestCase
index d6968717b5b46bb699b1eb1486d9d1c1327f3194..3a36db38e3dea0486b77402789a934cd663abdfa 100644 (file)
@@ -1,4 +1,6 @@
 <?php
-    @define('CONST_BasePath', '../..');
+    @define('CONST_LibDir', '../../lib');
+    @define('CONST_DataDir', '../..');
+
     @define('CONST_Debug', true);
     @define('CONST_NoAccessControl', false);