N°5608 - Fix some broken require paths since move/rename

This commit is contained in:
Molkobain
2022-10-14 23:07:19 +02:00
parent 87cb73c038
commit 6136eadd31
9 changed files with 27 additions and 23 deletions

View File

@@ -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;
}
}
/**

View File

@@ -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>

View File

@@ -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');
}

View File

@@ -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);

View File

@@ -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');
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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';
}
/**

View File

@@ -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();