From f62c65e9d94867de30f7b1379100ef0d08781838 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 17 Dec 2020 16:50:52 +0100 Subject: [PATCH] adapt php tests to new directory constants --- test/php/Nominatim/AddressDetailsTest.php | 6 +++--- test/php/Nominatim/ClassTypesTest.php | 2 +- test/php/Nominatim/DBTest.php | 4 ++-- test/php/Nominatim/DatabaseErrorTest.php | 4 ++-- test/php/Nominatim/DebugTest.php | 2 +- test/php/Nominatim/LibTest.php | 4 ++-- test/php/Nominatim/OutputTest.php | 2 +- test/php/Nominatim/ParameterParserTest.php | 2 +- test/php/Nominatim/PhraseTest.php | 2 +- test/php/Nominatim/SearchContextTest.php | 2 +- test/php/Nominatim/ShellTest.php | 2 +- test/php/Nominatim/StatusTest.php | 4 ++-- test/php/Nominatim/TokenListTest.php | 2 +- test/php/bootstrap.php | 4 +++- 14 files changed, 22 insertions(+), 20 deletions(-) diff --git a/test/php/Nominatim/AddressDetailsTest.php b/test/php/Nominatim/AddressDetailsTest.php index 4678911c..32f4f457 100644 --- a/test/php/Nominatim/AddressDetailsTest.php +++ b/test/php/Nominatim/AddressDetailsTest.php @@ -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) diff --git a/test/php/Nominatim/ClassTypesTest.php b/test/php/Nominatim/ClassTypesTest.php index 1ba79bdb..10256954 100644 --- a/test/php/Nominatim/ClassTypesTest.php +++ b/test/php/Nominatim/ClassTypesTest.php @@ -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 { diff --git a/test/php/Nominatim/DBTest.php b/test/php/Nominatim/DBTest.php index 1991f6f1..8a3157a8 100644 --- a/test/php/Nominatim/DBTest.php +++ b/test/php/Nominatim/DBTest.php @@ -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 diff --git a/test/php/Nominatim/DatabaseErrorTest.php b/test/php/Nominatim/DatabaseErrorTest.php index 7b461894..da156493 100644 --- a/test/php/Nominatim/DatabaseErrorTest.php +++ b/test/php/Nominatim/DatabaseErrorTest.php @@ -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 { diff --git a/test/php/Nominatim/DebugTest.php b/test/php/Nominatim/DebugTest.php index 5d9525ac..09860914 100644 --- a/test/php/Nominatim/DebugTest.php +++ b/test/php/Nominatim/DebugTest.php @@ -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 { diff --git a/test/php/Nominatim/LibTest.php b/test/php/Nominatim/LibTest.php index 28cd9af0..6e9038ee 100644 --- a/test/php/Nominatim/LibTest.php +++ b/test/php/Nominatim/LibTest.php @@ -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 { diff --git a/test/php/Nominatim/OutputTest.php b/test/php/Nominatim/OutputTest.php index b243ba47..cbfebb7d 100644 --- a/test/php/Nominatim/OutputTest.php +++ b/test/php/Nominatim/OutputTest.php @@ -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 { diff --git a/test/php/Nominatim/ParameterParserTest.php b/test/php/Nominatim/ParameterParserTest.php index 361fefc1..3b06e274 100644 --- a/test/php/Nominatim/ParameterParserTest.php +++ b/test/php/Nominatim/ParameterParserTest.php @@ -2,7 +2,7 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/ParameterParser.php'); +require_once(CONST_LibDir.'/ParameterParser.php'); function userError($sError) diff --git a/test/php/Nominatim/PhraseTest.php b/test/php/Nominatim/PhraseTest.php index ab031bb0..42166e34 100644 --- a/test/php/Nominatim/PhraseTest.php +++ b/test/php/Nominatim/PhraseTest.php @@ -2,7 +2,7 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/Phrase.php'); +require_once(CONST_LibDir.'/Phrase.php'); class TokensFullSet { diff --git a/test/php/Nominatim/SearchContextTest.php b/test/php/Nominatim/SearchContextTest.php index 2b575a16..1b346297 100644 --- a/test/php/Nominatim/SearchContextTest.php +++ b/test/php/Nominatim/SearchContextTest.php @@ -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 { diff --git a/test/php/Nominatim/ShellTest.php b/test/php/Nominatim/ShellTest.php index d0222ee1..2d81b71d 100644 --- a/test/php/Nominatim/ShellTest.php +++ b/test/php/Nominatim/ShellTest.php @@ -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 { diff --git a/test/php/Nominatim/StatusTest.php b/test/php/Nominatim/StatusTest.php index f45e6633..8cb8a703 100644 --- a/test/php/Nominatim/StatusTest.php +++ b/test/php/Nominatim/StatusTest.php @@ -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 diff --git a/test/php/Nominatim/TokenListTest.php b/test/php/Nominatim/TokenListTest.php index ca43aabb..3ef4d84d 100644 --- a/test/php/Nominatim/TokenListTest.php +++ b/test/php/Nominatim/TokenListTest.php @@ -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 diff --git a/test/php/bootstrap.php b/test/php/bootstrap.php index d6968717..3a36db38 100644 --- a/test/php/bootstrap.php +++ b/test/php/bootstrap.php @@ -1,4 +1,6 @@