mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 13:24:07 +00:00
adapt php tests to new directory constants
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/init-website.php');
|
require_once(CONST_LibDir.'/init-website.php');
|
||||||
require_once(CONST_BasePath.'/lib/AddressDetails.php');
|
require_once(CONST_LibDir.'/AddressDetails.php');
|
||||||
|
|
||||||
|
|
||||||
class AddressDetailsTest extends \PHPUnit\Framework\TestCase
|
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
|
// 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);
|
$data = json_decode($json, true);
|
||||||
|
|
||||||
$this->oDbStub = $this->getMockBuilder(\DB::class)
|
$this->oDbStub = $this->getMockBuilder(\DB::class)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/ClassTypes.php');
|
require_once(CONST_LibDir.'/ClassTypes.php');
|
||||||
|
|
||||||
class ClassTypesTest extends \PHPUnit\Framework\TestCase
|
class ClassTypesTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/lib.php');
|
require_once(CONST_LibDir.'/lib.php');
|
||||||
require_once(CONST_BasePath.'/lib/DB.php');
|
require_once(CONST_LibDir.'/DB.php');
|
||||||
|
|
||||||
// subclassing so we can set the protected connection variable
|
// subclassing so we can set the protected connection variable
|
||||||
class NominatimSubClassedDB extends \Nominatim\DB
|
class NominatimSubClassedDB extends \Nominatim\DB
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/init-website.php');
|
require_once(CONST_LibDir.'/init-website.php');
|
||||||
require_once(CONST_BasePath.'/lib/DatabaseError.php');
|
require_once(CONST_LibDir.'/DatabaseError.php');
|
||||||
|
|
||||||
class DatabaseErrorTest extends \PHPUnit\Framework\TestCase
|
class DatabaseErrorTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/DebugHtml.php');
|
require_once(CONST_LibDir.'/DebugHtml.php');
|
||||||
|
|
||||||
class DebugTest extends \PHPUnit\Framework\TestCase
|
class DebugTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/lib.php');
|
require_once(CONST_LibDir.'/lib.php');
|
||||||
require_once(CONST_BasePath.'/lib/ClassTypes.php');
|
require_once(CONST_LibDir.'/ClassTypes.php');
|
||||||
|
|
||||||
class LibTest extends \PHPUnit\Framework\TestCase
|
class LibTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/output.php');
|
require_once(CONST_LibDir.'/output.php');
|
||||||
|
|
||||||
class OutputTest extends \PHPUnit\Framework\TestCase
|
class OutputTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/ParameterParser.php');
|
require_once(CONST_LibDir.'/ParameterParser.php');
|
||||||
|
|
||||||
|
|
||||||
function userError($sError)
|
function userError($sError)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/Phrase.php');
|
require_once(CONST_LibDir.'/Phrase.php');
|
||||||
|
|
||||||
class TokensFullSet
|
class TokensFullSet
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/SearchContext.php');
|
require_once(CONST_LibDir.'/SearchContext.php');
|
||||||
|
|
||||||
class SearchContextTest extends \PHPUnit\Framework\TestCase
|
class SearchContextTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/Shell.php');
|
require_once(CONST_LibDir.'/Shell.php');
|
||||||
|
|
||||||
class ShellTest extends \PHPUnit\Framework\TestCase
|
class ShellTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/DB.php');
|
require_once(CONST_LibDir.'/DB.php');
|
||||||
require_once(CONST_BasePath.'/lib/Status.php');
|
require_once(CONST_LibDir.'/Status.php');
|
||||||
|
|
||||||
|
|
||||||
class StatusTest extends \PHPUnit\Framework\TestCase
|
class StatusTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/TokenList.php');
|
require_once(CONST_LibDir.'/TokenList.php');
|
||||||
|
|
||||||
|
|
||||||
class TokenTest extends \PHPUnit\Framework\TestCase
|
class TokenTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
@define('CONST_BasePath', '../..');
|
@define('CONST_LibDir', '../../lib');
|
||||||
|
@define('CONST_DataDir', '../..');
|
||||||
|
|
||||||
@define('CONST_Debug', true);
|
@define('CONST_Debug', true);
|
||||||
@define('CONST_NoAccessControl', false);
|
@define('CONST_NoAccessControl', false);
|
||||||
|
|||||||
Reference in New Issue
Block a user