mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°5608 - Fix some broken require paths since move/rename
This commit is contained in:
@@ -39,14 +39,16 @@ class ItopTestCase extends TestCase
|
||||
/** @noinspection UsingInclusionOnceReturnValueInspection avoid errors for approot includes */
|
||||
protected function setUp(): void
|
||||
{
|
||||
@include_once '../approot.inc.php';
|
||||
@include_once '../../approot.inc.php';
|
||||
@include_once '../../../approot.inc.php';
|
||||
@include_once '../../../../approot.inc.php';
|
||||
@include_once '../../../../../approot.inc.php';
|
||||
@include_once '../../../../../../approot.inc.php';
|
||||
@include_once '../../../../../../../approot.inc.php';
|
||||
@include_once '../../../../../../../../approot.inc.php';
|
||||
$sAppRootRelPath = 'approot.inc.php';
|
||||
$sDepthSeparator = '../';
|
||||
for ($iDepth = 0; $iDepth < 8; $iDepth++) {
|
||||
if (file_exists($sAppRootRelPath)) {
|
||||
require_once $sAppRootRelPath;
|
||||
break;
|
||||
}
|
||||
|
||||
$sAppRootRelPath = $sDepthSeparator.$sAppRootRelPath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -65,16 +65,16 @@
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Extensions">
|
||||
<directory>../../../env-production/*/test</directory>
|
||||
<directory>../../env-production/*/test</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<!-- Code coverage white list -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<file>../../../core/apc-emulation.php</file>
|
||||
<file>../../../core/ormlinkset.class.inc.php</file>
|
||||
<file>../../../datamodels/2.x/itop-tickets/main.itop-tickets.php</file>
|
||||
<file>../../core/apc-emulation.php</file>
|
||||
<file>../../core/ormlinkset.class.inc.php</file>
|
||||
<file>../../datamodels/2.x/itop-tickets/main.itop-tickets.php</file>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class WeeklyScheduledProcessTest extends ItopTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
require_once(APPROOT.'core/backgroundprocess.inc.php');
|
||||
require_once(APPROOT.'tests/core/WeeklyScheduledProcessMockConfig.php');
|
||||
require_once(APPROOT.'tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ class HTMLDOMSanitizerTest extends AbstractDOMSanitizerTest
|
||||
*/
|
||||
public function testDoSanitizeCallInlineImageProcessImageTag($sHtml, $iExpectedCount)
|
||||
{
|
||||
require_once APPROOT.'tests/core/sanitizer/InlineImageMock.php';
|
||||
require_once APPROOT.'tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php';
|
||||
InlineImageMock::ResetCallCounter();
|
||||
|
||||
$oSanitizer = new HTMLDOMSanitizer(InlineImageMock::class);
|
||||
|
||||
@@ -25,7 +25,7 @@ class UserLocalTest extends ItopDataTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
require_once(APPROOT.'tests/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php');
|
||||
require_once(APPROOT.'tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php');
|
||||
require_once(APPROOT.'env-production/authent-local/model.authent-local.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ class iTopConfigAstValidatorTest extends ItopTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
require_once __DIR__.'/../../../env-production/itop-config/src/Validator/ConfigNodesVisitor.php';
|
||||
require_once __DIR__.'/../../../env-production/itop-config/src/Validator/iTopConfigAstValidator.php';
|
||||
require_once APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php';
|
||||
require_once APPROOT.'env-production/itop-config/src/Validator/iTopConfigAstValidator.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ class iTopConfigSyntaxValidatorTest extends ItopTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
require_once __DIR__.'/../../../env-production/itop-config/src/Validator/ConfigNodesVisitor.php';
|
||||
require_once __DIR__.'/../../../env-production/itop-config/src/Validator/iTopConfigSyntaxValidator.php';
|
||||
require_once APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php';
|
||||
require_once APPROOT.'env-production/itop-config/src/Validator/iTopConfigSyntaxValidator.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class StatusIncTest extends TestCase {
|
||||
{
|
||||
//AppRoot is the directory containing the directory
|
||||
//Assume getcwd() is runned inside APPROOT/test
|
||||
$this->sAppRoot = __DIR__.'/../../sources/application/status';
|
||||
$this->sAppRoot = __DIR__.'/../../../../sources/application/status';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
//Include status functions
|
||||
require_once(__DIR__.'/../../sources/application/status/status.inc.php');
|
||||
//Do check Status
|
||||
// Include status functions
|
||||
// Important: We can't use the APPROOT constant here as the current script will be executed via the PHP exec() function which won't have it loaded yet.
|
||||
require_once __DIR__.'/../../../../sources/application/status/status.inc.php';
|
||||
|
||||
// Do check Status
|
||||
try
|
||||
{
|
||||
\Combodo\iTop\Application\Status\StatusStartup();
|
||||
|
||||
Reference in New Issue
Block a user