Grouping with functions
');
$oP->add('
');
diff --git a/tests/php-unit-tests/legacy-tests/README.md b/tests/php-unit-tests/legacy-tests/README.md
new file mode 100644
index 000000000..08c576281
--- /dev/null
+++ b/tests/php-unit-tests/legacy-tests/README.md
@@ -0,0 +1 @@
+Tests in this folder have been written before the introduction of PHPUnit in iTop, they are not run by the CI.
\ No newline at end of file
diff --git a/test/VerifyOQL.php b/tests/php-unit-tests/legacy-tests/VerifyOQL.php
similarity index 99%
rename from test/VerifyOQL.php
rename to tests/php-unit-tests/legacy-tests/VerifyOQL.php
index 1b76d2527..cb673942e 100644
--- a/test/VerifyOQL.php
+++ b/tests/php-unit-tests/legacy-tests/VerifyOQL.php
@@ -23,7 +23,7 @@
* You should have received a copy of the GNU Affero General Public License
*/
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/startup.inc.php');
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
diff --git a/test/benchmark.php b/tests/php-unit-tests/legacy-tests/benchmark.php
similarity index 99%
rename from test/benchmark.php
rename to tests/php-unit-tests/legacy-tests/benchmark.php
index 4d6a7f983..148007bb1 100644
--- a/test/benchmark.php
+++ b/tests/php-unit-tests/legacy-tests/benchmark.php
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
*/
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/wizardhelper.class.inc.php');
require_once(APPROOT.'/application/startup.inc.php');
diff --git a/test/build_test_oql.php b/tests/php-unit-tests/legacy-tests/build_test_oql.php
similarity index 96%
rename from test/build_test_oql.php
rename to tests/php-unit-tests/legacy-tests/build_test_oql.php
index fb2320dbb..bae184965 100644
--- a/test/build_test_oql.php
+++ b/tests/php-unit-tests/legacy-tests/build_test_oql.php
@@ -22,13 +22,13 @@
*/
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'application/startup.inc.php');
\LoginWebPage::DoLogin(true);
$sOQLFile = APPROOT.'log/oql_records.txt';
-$sTestFile = APPROOT.'test/core/oql_records.php';
+$sTestFile = APPROOT.'tests/core/oql_records.php';
$oTestHandle = @fopen($sTestFile, "w");
@@ -77,7 +77,7 @@ echo "File '$sTestFile' generated with $iCount entries (from $iRead captured OQL
$sOQLFile = APPROOT.'log/oql_group_by_records.txt';
-$sTestFile = APPROOT.'test/core/oql_group_by_records.php';
+$sTestFile = APPROOT.'tests/core/oql_group_by_records.php';
$oTestHandle = @fopen($sTestFile, "w");
diff --git a/test/config-test-farm.php b/tests/php-unit-tests/legacy-tests/config-test-farm.php
similarity index 100%
rename from test/config-test-farm.php
rename to tests/php-unit-tests/legacy-tests/config-test-farm.php
diff --git a/test/display_cache_content.php b/tests/php-unit-tests/legacy-tests/display_cache_content.php
similarity index 98%
rename from test/display_cache_content.php
rename to tests/php-unit-tests/legacy-tests/display_cache_content.php
index 581576799..be2b6be76 100644
--- a/test/display_cache_content.php
+++ b/tests/php-unit-tests/legacy-tests/display_cache_content.php
@@ -21,7 +21,7 @@
* Date: 06/10/2017
*/
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'application/startup.inc.php');
diff --git a/test/replay_query_log.php b/tests/php-unit-tests/legacy-tests/replay_query_log.php
similarity index 99%
rename from test/replay_query_log.php
rename to tests/php-unit-tests/legacy-tests/replay_query_log.php
index 55e7e1984..0a739294e 100644
--- a/test/replay_query_log.php
+++ b/tests/php-unit-tests/legacy-tests/replay_query_log.php
@@ -203,7 +203,7 @@ class QueryLogEntry
//
/////////////////////////////////////////////////////////////////////////////
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/ajaxwebpage.class.inc.php');
diff --git a/test/test.class.inc.php b/tests/php-unit-tests/legacy-tests/test.class.inc.php
similarity index 100%
rename from test/test.class.inc.php
rename to tests/php-unit-tests/legacy-tests/test.class.inc.php
diff --git a/test/test.php b/tests/php-unit-tests/legacy-tests/test.php
similarity index 98%
rename from test/test.php
rename to tests/php-unit-tests/legacy-tests/test.php
index 0566430dc..236c336ef 100644
--- a/test/test.php
+++ b/tests/php-unit-tests/legacy-tests/test.php
@@ -85,7 +85,7 @@ function DisplayEvents($aEvents, $sTitle)
date_default_timezone_set('Europe/Paris');
-require_once('../approot.inc.php');
+require_once('../../../approot.inc.php');
require_once(APPROOT.'/application/utils.inc.php');
require_once('./test.class.inc.php');
require_once('./testlist.inc.php');
diff --git a/test/testlist.inc.php b/tests/php-unit-tests/legacy-tests/testlist.inc.php
similarity index 100%
rename from test/testlist.inc.php
rename to tests/php-unit-tests/legacy-tests/testlist.inc.php
diff --git a/test/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist
similarity index 56%
rename from test/phpunit.xml.dist
rename to tests/php-unit-tests/phpunit.xml.dist
index ce3d1057c..f58cbcab2 100644
--- a/test/phpunit.xml.dist
+++ b/tests/php-unit-tests/phpunit.xml.dist
@@ -28,50 +28,52 @@
-
- ../env-production/*/test
+
+
+ unitary-tests/application
- core
+ unitary-tests/core
-
- webservices
-
-
- itop-tickets
-
-
- itop-config
-
-
- application
+
+ unitary-tests/datamodels/2.x
- setup
+ unitary-tests/setup
-
- status
+
+
+ unitary-tests/sources/application/search
+
+
+ unitary-tests/sources/application/status
+
+
+ unitary-tests/sources/Composer
- synchro
+ unitary-tests/synchro
-
- setup
+
+ unitary-tests/webservices
+
+
+ ../../env-production/*/test
+
+
+
- integration
-
-
- coreExtensions
+ integration-tests
- ../core/apc-emulation.php
- ../core/ormlinkset.class.inc.php
- ../datamodels/2.x/itop-tickets/main.itop-tickets.php
+ ../../core/apc-emulation.php
+ ../../core/ormlinkset.class.inc.php
+ ../../datamodels/2.x/itop-tickets/main.itop-tickets.php
diff --git a/test/postbuild_integration/SetupCssIntegrityChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php
similarity index 100%
rename from test/postbuild_integration/SetupCssIntegrityChecklistTest.php
rename to tests/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php
diff --git a/test/postbuild_integration/iTopDesignFormatChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php
similarity index 97%
rename from test/postbuild_integration/iTopDesignFormatChecklistTest.php
rename to tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php
index 20b1063c1..875fd01ec 100644
--- a/test/postbuild_integration/iTopDesignFormatChecklistTest.php
+++ b/tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php
@@ -21,8 +21,8 @@ class TestForITopDesignFormatClass extends ItopTestCase
{
parent::setUp();
- require_once APPROOT.'setup/modelfactory.class.inc.php';
- require_once APPROOT.'setup/itopdesignformat.class.inc.php';
+ $this->RequireOnceItopFile('setup/modelfactory.class.inc.php');
+ $this->RequireOnceItopFile('setup/itopdesignformat.class.inc.php');
}
/**
diff --git a/test/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php
similarity index 100%
rename from test/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php
rename to tests/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php
diff --git a/test/postbuild_integration.xml.dist b/tests/php-unit-tests/postbuild_integration.xml.dist
similarity index 79%
rename from test/postbuild_integration.xml.dist
rename to tests/php-unit-tests/postbuild_integration.xml.dist
index 5e701b93d..b45e634bb 100644
--- a/test/postbuild_integration.xml.dist
+++ b/tests/php-unit-tests/postbuild_integration.xml.dist
@@ -27,16 +27,16 @@
- postbuild_integration
+ post-build-integration-tests
- ../core/apc-emulation.php
- ../core/ormlinkset.class.inc.php
- ../datamodels/2.x/itop-tickets/main.itop-tickets.php
+ ../../../core/apc-emulation.php
+ ../../../core/ormlinkset.class.inc.php
+ ../../../datamodels/2.x/itop-tickets/main.itop-tickets.php
diff --git a/test/application/DashboardLayoutTest.php b/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php
similarity index 100%
rename from test/application/DashboardLayoutTest.php
rename to tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php
diff --git a/test/application/SCSSCompilationTest.php b/tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php
similarity index 100%
rename from test/application/SCSSCompilationTest.php
rename to tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php
diff --git a/test/application/Session/SessionTest.php b/tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php
similarity index 100%
rename from test/application/Session/SessionTest.php
rename to tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php
diff --git a/test/application/ThemeHandlerTest.php b/tests/php-unit-tests/unitary-tests/application/ThemeHandlerTest.php
similarity index 91%
rename from test/application/ThemeHandlerTest.php
rename to tests/php-unit-tests/unitary-tests/application/ThemeHandlerTest.php
index ca9ded701..15a530f3d 100644
--- a/test/application/ThemeHandlerTest.php
+++ b/tests/php-unit-tests/unitary-tests/application/ThemeHandlerTest.php
@@ -23,9 +23,9 @@ class ThemeHandlerTest extends ItopTestCase
public function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'application/themehandler.class.inc.php');
- require_once(APPROOT.'setup/modelfactory.class.inc.php');
- require_once(APPROOT.'test/setup/SubMFCompiler.php');
+ $this->RequireOnceItopFile('application/themehandler.class.inc.php');
+ $this->RequireOnceItopFile('setup/modelfactory.class.inc.php');
+ $this->RequireOnceUnitTestFile('../setup/SubMFCompiler.php');
$this->oCompileCSSServiceMock = $this->createMock('CompileCSSService');
ThemeHandler::mockCompileCSSService($this->oCompileCSSServiceMock);
@@ -39,7 +39,7 @@ class ThemeHandlerTest extends ItopTestCase
$this->sCssAbsPath = $this->sCompiledThemesDirAbsPath.'basque-red/main.css';
$this->sDmCssAbsPath = $this->sCompiledThemesDirAbsPath.'datamodel-compiled-scss-rules.scss';
$this->sJsonThemeParamFile = $this->sCompiledThemesDirAbsPath.'basque-red/theme-parameters.json';
- $this->RecurseCopy(APPROOT."/test/application/theme-handler/expected/css", $this->sTmpDir."/branding/css");
+ $this->RecurseCopy(APPROOT."/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css", $this->sTmpDir."/branding/css");
}
public function tearDown(): void
@@ -114,7 +114,7 @@ class ThemeHandlerTest extends ItopTestCase
public function testGetSignature()
{
- $sSig = ThemeHandler::GetSignature(APPROOT.'test/application/theme-handler/expected/themes/basque-red/main.css');
+ $sSig = ThemeHandler::GetSignature(APPROOT.'tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main.css');
$sExpectedSig=<<sJsonThemeParamFile))
@@ -167,7 +167,7 @@ JSON;
}
$this->assertTrue(is_file($this->sCssAbsPath));
$this->assertEquals($sExpectedThemeParamJson, file_get_contents($this->sJsonThemeParamFile));
- $this->assertEquals(file_get_contents(APPROOT . 'test/application/theme-handler/expected/themes/basque-red/main.css'), file_get_contents($this->sCssAbsPath));
+ $this->assertEquals(file_get_contents(APPROOT . 'tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main.css'), file_get_contents($this->sCssAbsPath));
}
public function CompileThemesProviderWithoutCss()
@@ -189,7 +189,7 @@ JSON;
public function testCompileThemesEmptyArray($ThemeParametersJson, $CompileCount=0)
{
$sCssPath = $this->sTmpDir . '/branding/themes/basque-red/main.css';
- copy(APPROOT . 'test/application/theme-handler/expected/themes/basque-red/main.css', $sCssPath);
+ copy(APPROOT . 'tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main.css', $sCssPath);
$this->oCompileCSSServiceMock->expects($this->exactly($CompileCount))
->method("CompileCSSFromSASS")
@@ -218,12 +218,12 @@ JSON;
$sModifiedVariableThemeParameterJson='{"variables":{"brand-primary1":"#C53030","hover-background-color":"#F6F6F6","icons-filter":"grayscale(1)","search-form-container-bg-color":"#4A5568"},"variable_imports":{"css-variables":"..\/css\/DO_NOT_CHANGE.css-variables.scss"},"stylesheets":{"jqueryui":"..\/css\/ui-lightness\/DO_NOT_CHANGE.jqueryui.scss","main":"..\/css\/DO_NOT_CHANGE.light-grey.scss"},"utility_imports":[]}';
$sInitialThemeParamJson='{"variables":{"brand-primary":"#C53030","hover-background-color":"#F6F6F6","icons-filter":"grayscale(1)","search-form-container-bg-color":"#4A5568"},"variable_imports":{"css-variables":"..\/css\/DO_NOT_CHANGE.css-variables.scss"},"stylesheets":{"jqueryui":"..\/css\/ui-lightness\/DO_NOT_CHANGE.jqueryui.scss","main":"..\/css\/DO_NOT_CHANGE.light-grey.scss"},"utility_imports":[]}';
$sImportFilePath = '/branding/css/DO_NOT_CHANGE.css-variables.scss';
- $sVarChangedMainCssPath="test/application/theme-handler/expected/themes/basque-red/main_varchanged.css";
- $sStylesheetMainCssPath="test/application/theme-handler/expected/themes/basque-red/main_stylesheet.css";
- $sImageMainCssPath="test/application/theme-handler/expected/themes/basque-red/main_imagemodified.css";
- $sImportModifiedMainCssPath="test/application/theme-handler/expected/themes/basque-red/main_importmodified.css";
+ $sVarChangedMainCssPath="tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_varchanged.css";
+ $sStylesheetMainCssPath="tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_stylesheet.css";
+ $sImageMainCssPath="tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_imagemodified.css";
+ $sImportModifiedMainCssPath="tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_importmodified.css";
$sStylesheetFilePath = '/branding/css/DO_NOT_CHANGE.light-grey.scss';
- $sImageFilePath = 'test/application/theme-handler/copied/testimages/images/green-header.gif';
+ $sImageFilePath = 'tests/php-unit-tests/unitary-tests/application/theme-handler/copied/testimages/images/green-header.gif';
return [
"setup context: variables list modified without any file touched" => [$sModifiedVariableThemeParameterJson, 1,false,false,false,$sImportFilePath, $sVarChangedMainCssPath],
"setup context: variables list modified with files touched" => [$sModifiedVariableThemeParameterJson, 1,false,true,false,$sImportFilePath, $sVarChangedMainCssPath, false],
@@ -268,10 +268,10 @@ JSON;
}
//copy images in test dir
- $sAbsoluteImagePath = APPROOT.'test/application/theme-handler/copied/testimages/';
+ $sAbsoluteImagePath = APPROOT.'tests/php-unit-tests/unitary-tests/application/theme-handler/copied/testimages/';
$this->recurseMkdir($sAbsoluteImagePath);
$this->aDirsToCleanup[] = dirname($sAbsoluteImagePath);
- $this->RecurseCopy(APPROOT.'test/application/theme-handler/expected/testimages/', $sAbsoluteImagePath);
+ $this->RecurseCopy(APPROOT.'tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/', $sAbsoluteImagePath);
//change approot-relative in css-variable to use absolute path
$sCssVarPath = $this->sTmpDir."/branding/css/DO_NOT_CHANGE.css-variables.scss";
@@ -293,7 +293,7 @@ JSON;
}
//change cssvar md5sum + image absolute paths
- $sMainCssContent = file_get_contents(APPROOT."test/application/theme-handler/expected/themes/basque-red/main_testcompilethemes.css");
+ $sMainCssContent = file_get_contents(APPROOT."tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_testcompilethemes.css");
$sMainCssContent = preg_replace('/MD5SUM/', $sAfterReplacementCssVariableMd5sum, $sMainCssContent);
$sReplacement = rtrim($sAbsoluteImagePath, '/');
$sReplacement=preg_replace('|\/|', '\/', $sReplacement);
@@ -409,7 +409,7 @@ JSON;
*/
public function GetAllUrlFromScssProvider()
{
- return ['test-getimages.scss' => ['test/application/theme-handler/getimages/test-getimages.scss']];
+ return ['test-getimages.scss' => ['tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/test-getimages.scss']];
}
public function testFindMissingVariables()
@@ -513,7 +513,7 @@ SCSS;
{
$aStylesheetFile=glob($this->sTmpDir."/branding/css/*.scss");
$aStylesheetFile[]=$this->sTmpDir."/branding/css/ui-lightness/DO_NOT_CHANGE.jqueryui.scss";
- $expectJsonFilePath = APPROOT.'test/application/theme-handler/expected/themes/basque-red/theme-parameters.json';
+ $expectJsonFilePath = APPROOT.'tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/theme-parameters.json';
$expectedThemeParamJson = file_get_contents($expectJsonFilePath);
$aThemeParametersVariables = json_decode($expectedThemeParamJson, true);
@@ -522,7 +522,7 @@ SCSS;
$aIncludedImages = ThemeHandler::GetIncludedImages($aThemeParametersVariables['variables'], $aStylesheetFile, "basque-red");
- $aExpectedUris = json_decode(file_get_contents(APPROOT.'test/application/theme-handler/getimages/expected-getimages.json'), true);
+ $aExpectedUris = json_decode(file_get_contents(APPROOT.'tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/expected-getimages.json'), true);
$aExpectedImages = [];
foreach ($aExpectedUris as $sExpectedUri)
{
diff --git a/test/application/privUITransactionFileTest.php b/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php
similarity index 100%
rename from test/application/privUITransactionFileTest.php
rename to tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php
diff --git a/test/application/theme-handler/expected/css/DO_NOT_CHANGE.css-variables.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/DO_NOT_CHANGE.css-variables.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/DO_NOT_CHANGE.css-variables.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/DO_NOT_CHANGE.css-variables.scss
diff --git a/test/application/theme-handler/expected/css/DO_NOT_CHANGE.light-grey.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/DO_NOT_CHANGE.light-grey.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/DO_NOT_CHANGE.light-grey.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/DO_NOT_CHANGE.light-grey.scss
diff --git a/test/application/theme-handler/expected/css/README.md b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/README.md
similarity index 100%
rename from test/application/theme-handler/expected/css/README.md
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/README.md
diff --git a/test/application/theme-handler/expected/css/_included_file3.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/_included_file3.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/_included_file3.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/_included_file3.scss
diff --git a/test/application/theme-handler/expected/css/cross_reference1.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/cross_reference1.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/cross_reference1.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/cross_reference1.scss
diff --git a/test/application/theme-handler/expected/css/cross_reference2.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/cross_reference2.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/cross_reference2.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/cross_reference2.scss
diff --git a/test/application/theme-handler/expected/css/feature1/_feature1.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/feature1/_feature1.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/feature1/_feature1.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/feature1/_feature1.scss
diff --git a/test/application/theme-handler/expected/css/included_file1.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_file1.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/included_file1.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_file1.scss
diff --git a/test/application/theme-handler/expected/css/included_scss/included_file2.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_scss/included_file2.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/included_scss/included_file2.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_scss/included_file2.scss
diff --git a/test/application/theme-handler/expected/css/included_scss/included_file4.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_scss/included_file4.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/included_scss/included_file4.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/included_scss/included_file4.scss
diff --git a/test/application/theme-handler/expected/css/multi_imports.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/multi_imports.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/multi_imports.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/multi_imports.scss
diff --git a/test/application/theme-handler/expected/css/shortcut.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/shortcut.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/shortcut.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/shortcut.scss
diff --git a/test/application/theme-handler/expected/css/shortcut2.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/shortcut2.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/shortcut2.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/shortcut2.scss
diff --git a/test/application/theme-handler/expected/css/simple_import.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/simple_import.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/simple_import.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/simple_import.scss
diff --git a/test/application/theme-handler/expected/css/simple_import2.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/simple_import2.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/simple_import2.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/simple_import2.scss
diff --git a/test/application/theme-handler/expected/css/typography.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/typography.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/typography.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/typography.scss
diff --git a/test/application/theme-handler/expected/css/ui-lightness/DO_NOT_CHANGE.jqueryui.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/ui-lightness/DO_NOT_CHANGE.jqueryui.scss
similarity index 100%
rename from test/application/theme-handler/expected/css/ui-lightness/DO_NOT_CHANGE.jqueryui.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/css/ui-lightness/DO_NOT_CHANGE.jqueryui.scss
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_1c94c4_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_1c94c4_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_1c94c4_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_1c94c4_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_222222_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_222222_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_222222_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_222222_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_E87C1E_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_E87C1E_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_E87C1E_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_E87C1E_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_F26522_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_F26522_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_F26522_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_F26522_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffffff_256x240.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffffff_256x240.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/css/ui-lightness/images/ui-icons_ffffff_256x240.png
diff --git a/test/application/theme-handler/expected/testimages/images/ac-background.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/ac-background.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/ac-background.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/ac-background.gif
diff --git a/test/application/theme-handler/expected/testimages/images/actions_right.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/actions_right.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/actions_right.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/actions_right.png
diff --git a/test/application/theme-handler/expected/testimages/images/bg.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/bg.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/bg.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/bg.gif
diff --git a/test/application/theme-handler/expected/testimages/images/breadcrumb-separator.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/breadcrumb-separator.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/breadcrumb-separator.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/breadcrumb-separator.png
diff --git a/test/application/theme-handler/expected/testimages/images/calendar.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/calendar.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/calendar.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/calendar.png
diff --git a/test/application/theme-handler/expected/testimages/images/delete.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/delete.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/delete.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/delete.png
diff --git a/test/application/theme-handler/expected/testimages/images/desc.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/desc.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/desc.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/desc.gif
diff --git a/test/application/theme-handler/expected/testimages/images/error.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/error.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/error.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/error.png
diff --git a/test/application/theme-handler/expected/testimages/images/eye-closed-555.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-closed-555.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/eye-closed-555.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-closed-555.png
diff --git a/test/application/theme-handler/expected/testimages/images/eye-closed-fff.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-closed-fff.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/eye-closed-fff.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-closed-fff.png
diff --git a/test/application/theme-handler/expected/testimages/images/eye-open-555.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-open-555.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/eye-open-555.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-open-555.png
diff --git a/test/application/theme-handler/expected/testimages/images/eye-open-fff.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-open-fff.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/eye-open-fff.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/eye-open-fff.png
diff --git a/test/application/theme-handler/expected/testimages/images/full-screen.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/full-screen.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/full-screen.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/full-screen.png
diff --git a/test/application/theme-handler/expected/testimages/images/green-header.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/green-header.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/green-header.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/green-header.gif
diff --git a/test/application/theme-handler/expected/testimages/images/green-square.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/green-square.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/green-square.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/green-square.gif
diff --git a/test/application/theme-handler/expected/testimages/images/indicator.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/indicator.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/indicator.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/indicator.gif
diff --git a/test/application/theme-handler/expected/testimages/images/info-mini.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/info-mini.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/info-mini.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/info-mini.png
diff --git a/test/application/theme-handler/expected/testimages/images/minus.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/minus.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/minus.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/minus.gif
diff --git a/test/application/theme-handler/expected/testimages/images/ok.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/ok.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/ok.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/ok.png
diff --git a/test/application/theme-handler/expected/testimages/images/orange-header.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/orange-header.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/orange-header.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/orange-header.gif
diff --git a/test/application/theme-handler/expected/testimages/images/plus.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/plus.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/plus.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/plus.gif
diff --git a/test/application/theme-handler/expected/testimages/images/red-header.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/red-header.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/red-header.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/red-header.gif
diff --git a/test/application/theme-handler/expected/testimages/images/truncated.png b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/truncated.png
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/truncated.png
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/truncated.png
diff --git a/test/application/theme-handler/expected/testimages/images/tv-collapsable-last.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-collapsable-last.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-collapsable-last.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-collapsable-last.gif
diff --git a/test/application/theme-handler/expected/testimages/images/tv-collapsable.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-collapsable.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-collapsable.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-collapsable.gif
diff --git a/test/application/theme-handler/expected/testimages/images/tv-expandable-last.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-expandable-last.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-expandable-last.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-expandable-last.gif
diff --git a/test/application/theme-handler/expected/testimages/images/tv-expandable.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-expandable.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-expandable.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-expandable.gif
diff --git a/test/application/theme-handler/expected/testimages/images/tv-item-last.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-item-last.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-item-last.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-item-last.gif
diff --git a/test/application/theme-handler/expected/testimages/images/tv-item.gif b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-item.gif
similarity index 100%
rename from test/application/theme-handler/expected/testimages/images/tv-item.gif
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/testimages/images/tv-item.gif
diff --git a/test/application/theme-handler/expected/themes/basque-red/main.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main.css
similarity index 100%
rename from test/application/theme-handler/expected/themes/basque-red/main.css
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main.css
diff --git a/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_imagemodified.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_imagemodified.css
new file mode 100644
index 000000000..fae29e7eb
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_imagemodified.css
@@ -0,0 +1,6 @@
+/*
+=== SIGNATURE BEGIN ===
+{"variables":"37c31105548fce44fecca5cb34e455c9","stylesheets":{"jqueryui":"78cfafc3524dac98e61fc2460918d4e5","main":"52d8a7c5530ceb3a4d777364fa4e1eea"},"variable_imports":{"css-variables":"MD5SUM"},"images":{"tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_222222_256x240.png":"3a3c5468f484f07ac4a320d9e22acb8c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_20_666666_40x40.png":"4429d568c67d8dfeb9040273ea0fb8c4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_E87C1E_256x240.png":"7003dd36cb2aa032c8ec871ce4d4e03d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_1c94c4_256x240.png":"dbd693dc8e0ef04e90a2f7ac7b390086","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_F26522_256x240.png":"16278ec0c07270be571f4c2e97fcc10c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_18_b81900_40x40.png":"e460a66d4b3e093fc651e62a236267cb","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffffff_256x240.png":"41612b0f4a034424f8321c9f824a94da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffd27a_256x240.png":"dda1b6f694b0d196aefc66a1d6d758f6","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/actions_right.png":"31c8906bd25d27b83a0a2466bf903462","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ac-background.gif":"76135f3697b41a15aed787cfd77776c7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-square.gif":"16ea9a497d72f5e66e4e8ea9ae08024e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item.gif":"719fe2d4566108e73162fb8868d3778c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable.gif":"63a3351ea0d580797c9b8c386aa4f48b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable.gif":"a2d1af4128e4a798a7f3390b12a28574","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item-last.gif":"2ae7e1d9972ce71e5caa65a086bc5b7e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable-last.gif":"71acaa9d7c2616e9e8b7131a75ca65da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable-last.gif":"9d51036b3a8102742709da66789fd0f7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/red-header.gif":"c73b8765f0c8c3c183cb6a0c2bb0ec69","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-header.gif":"06886d405efe86b85023ef64c4349095","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/orange-header.gif":"ce1f93f0af64431771b4cbd6c99c567b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/calendar.png":"ab56e59af3c96ca661821257d376465e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/truncated.png":"c6f91108afe8159d417b4dc556cd3b2a","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/plus.gif":"f00e1e6e1161f48608bb2bbc79b9948c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/minus.gif":"6d77c0c0c2f86b6995d1cdf78274eaab","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/full-screen.png":"b541fadd3f1563856a4b44aeebd9d563","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/indicator.gif":"03ce3dcc84af110e9da8699a841e5200","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/delete.png":"93c047549c31a270a037840277cf59d3","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/bg.gif":"a315146ab814c73632480136576cd271","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/desc.gif":"0f58b33929095ea17795dd53bbced5d9","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/info-mini.png":"445c090ed777c5e6a08ac390fa896193","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ok.png":"f6973773335fd83d8d2875f9a3c925af","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/error.png":"1af8a1041016f67669c5fd22dc88c82e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-555.png":"9940f4e5b1248042c238e1924359fd5e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-555.png":"6ad3b0bae791bf61addc9d8ca80a642d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-fff.png":"b7db2402d4d5c72314c25790a66150d4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-fff.png":"f9be7454dbb47b0e0bca3aa370ae7db5","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/breadcrumb-separator.png":"1e7e50a8f573e230cf1e0f0399c516e8"},"utility_imports":[]}
+=== SIGNATURE END ===
+*/
+====CSSCOMPILEDCONTENT====
\ No newline at end of file
diff --git a/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_importmodified.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_importmodified.css
new file mode 100644
index 000000000..138f81987
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_importmodified.css
@@ -0,0 +1,6 @@
+/*
+=== SIGNATURE BEGIN ===
+{"variables":"37c31105548fce44fecca5cb34e455c9","stylesheets":{"jqueryui":"78cfafc3524dac98e61fc2460918d4e5","main":"52d8a7c5530ceb3a4d777364fa4e1eea"},"variable_imports":{"css-variables":"MD5SUM"},"images":{"tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_222222_256x240.png":"3a3c5468f484f07ac4a320d9e22acb8c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_20_666666_40x40.png":"4429d568c67d8dfeb9040273ea0fb8c4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_E87C1E_256x240.png":"7003dd36cb2aa032c8ec871ce4d4e03d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_1c94c4_256x240.png":"dbd693dc8e0ef04e90a2f7ac7b390086","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_F26522_256x240.png":"16278ec0c07270be571f4c2e97fcc10c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_18_b81900_40x40.png":"e460a66d4b3e093fc651e62a236267cb","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffffff_256x240.png":"41612b0f4a034424f8321c9f824a94da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffd27a_256x240.png":"dda1b6f694b0d196aefc66a1d6d758f6","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/actions_right.png":"31c8906bd25d27b83a0a2466bf903462","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ac-background.gif":"76135f3697b41a15aed787cfd77776c7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-square.gif":"16ea9a497d72f5e66e4e8ea9ae08024e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item.gif":"719fe2d4566108e73162fb8868d3778c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable.gif":"63a3351ea0d580797c9b8c386aa4f48b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable.gif":"a2d1af4128e4a798a7f3390b12a28574","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item-last.gif":"2ae7e1d9972ce71e5caa65a086bc5b7e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable-last.gif":"71acaa9d7c2616e9e8b7131a75ca65da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable-last.gif":"9d51036b3a8102742709da66789fd0f7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/red-header.gif":"c73b8765f0c8c3c183cb6a0c2bb0ec69","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-header.gif":"0e22a09bb8051b2a274b3427ede62e82","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/orange-header.gif":"ce1f93f0af64431771b4cbd6c99c567b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/calendar.png":"ab56e59af3c96ca661821257d376465e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/truncated.png":"c6f91108afe8159d417b4dc556cd3b2a","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/plus.gif":"f00e1e6e1161f48608bb2bbc79b9948c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/minus.gif":"6d77c0c0c2f86b6995d1cdf78274eaab","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/full-screen.png":"b541fadd3f1563856a4b44aeebd9d563","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/indicator.gif":"03ce3dcc84af110e9da8699a841e5200","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/delete.png":"93c047549c31a270a037840277cf59d3","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/bg.gif":"a315146ab814c73632480136576cd271","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/desc.gif":"0f58b33929095ea17795dd53bbced5d9","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/info-mini.png":"445c090ed777c5e6a08ac390fa896193","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ok.png":"f6973773335fd83d8d2875f9a3c925af","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/error.png":"1af8a1041016f67669c5fd22dc88c82e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-555.png":"9940f4e5b1248042c238e1924359fd5e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-555.png":"6ad3b0bae791bf61addc9d8ca80a642d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-fff.png":"b7db2402d4d5c72314c25790a66150d4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-fff.png":"f9be7454dbb47b0e0bca3aa370ae7db5","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/breadcrumb-separator.png":"1e7e50a8f573e230cf1e0f0399c516e8"},"utility_imports":[]}
+=== SIGNATURE END ===
+*/
+====CSSCOMPILEDCONTENT====
\ No newline at end of file
diff --git a/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_stylesheet.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_stylesheet.css
new file mode 100644
index 000000000..fdf8525d8
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_stylesheet.css
@@ -0,0 +1,6 @@
+/*
+=== SIGNATURE BEGIN ===
+{"variables":"37c31105548fce44fecca5cb34e455c9","stylesheets":{"jqueryui":"78cfafc3524dac98e61fc2460918d4e5","main":"63ba7dfe2a2eba40c2596ebb2a405f0b"},"variable_imports":{"css-variables":"MD5SUM"},"images":{"tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_222222_256x240.png":"3a3c5468f484f07ac4a320d9e22acb8c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_20_666666_40x40.png":"4429d568c67d8dfeb9040273ea0fb8c4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_E87C1E_256x240.png":"7003dd36cb2aa032c8ec871ce4d4e03d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_1c94c4_256x240.png":"dbd693dc8e0ef04e90a2f7ac7b390086","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_F26522_256x240.png":"16278ec0c07270be571f4c2e97fcc10c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_18_b81900_40x40.png":"e460a66d4b3e093fc651e62a236267cb","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffffff_256x240.png":"41612b0f4a034424f8321c9f824a94da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffd27a_256x240.png":"dda1b6f694b0d196aefc66a1d6d758f6","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/actions_right.png":"31c8906bd25d27b83a0a2466bf903462","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ac-background.gif":"76135f3697b41a15aed787cfd77776c7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-square.gif":"16ea9a497d72f5e66e4e8ea9ae08024e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item.gif":"719fe2d4566108e73162fb8868d3778c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable.gif":"63a3351ea0d580797c9b8c386aa4f48b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable.gif":"a2d1af4128e4a798a7f3390b12a28574","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item-last.gif":"2ae7e1d9972ce71e5caa65a086bc5b7e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable-last.gif":"71acaa9d7c2616e9e8b7131a75ca65da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable-last.gif":"9d51036b3a8102742709da66789fd0f7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/red-header.gif":"c73b8765f0c8c3c183cb6a0c2bb0ec69","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-header.gif":"0e22a09bb8051b2a274b3427ede62e82","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/orange-header.gif":"ce1f93f0af64431771b4cbd6c99c567b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/calendar.png":"ab56e59af3c96ca661821257d376465e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/truncated.png":"c6f91108afe8159d417b4dc556cd3b2a","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/plus.gif":"f00e1e6e1161f48608bb2bbc79b9948c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/minus.gif":"6d77c0c0c2f86b6995d1cdf78274eaab","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/full-screen.png":"b541fadd3f1563856a4b44aeebd9d563","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/indicator.gif":"03ce3dcc84af110e9da8699a841e5200","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/delete.png":"93c047549c31a270a037840277cf59d3","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/bg.gif":"a315146ab814c73632480136576cd271","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/desc.gif":"0f58b33929095ea17795dd53bbced5d9","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/info-mini.png":"445c090ed777c5e6a08ac390fa896193","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ok.png":"f6973773335fd83d8d2875f9a3c925af","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/error.png":"1af8a1041016f67669c5fd22dc88c82e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-555.png":"9940f4e5b1248042c238e1924359fd5e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-555.png":"6ad3b0bae791bf61addc9d8ca80a642d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-fff.png":"b7db2402d4d5c72314c25790a66150d4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-fff.png":"f9be7454dbb47b0e0bca3aa370ae7db5","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/breadcrumb-separator.png":"1e7e50a8f573e230cf1e0f0399c516e8"},"utility_imports":[]}
+=== SIGNATURE END ===
+*/
+====CSSCOMPILEDCONTENT====
\ No newline at end of file
diff --git a/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_testcompilethemes.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_testcompilethemes.css
new file mode 100644
index 000000000..138f81987
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_testcompilethemes.css
@@ -0,0 +1,6 @@
+/*
+=== SIGNATURE BEGIN ===
+{"variables":"37c31105548fce44fecca5cb34e455c9","stylesheets":{"jqueryui":"78cfafc3524dac98e61fc2460918d4e5","main":"52d8a7c5530ceb3a4d777364fa4e1eea"},"variable_imports":{"css-variables":"MD5SUM"},"images":{"tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_222222_256x240.png":"3a3c5468f484f07ac4a320d9e22acb8c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_20_666666_40x40.png":"4429d568c67d8dfeb9040273ea0fb8c4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_E87C1E_256x240.png":"7003dd36cb2aa032c8ec871ce4d4e03d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_1c94c4_256x240.png":"dbd693dc8e0ef04e90a2f7ac7b390086","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_F26522_256x240.png":"16278ec0c07270be571f4c2e97fcc10c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_18_b81900_40x40.png":"e460a66d4b3e093fc651e62a236267cb","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffffff_256x240.png":"41612b0f4a034424f8321c9f824a94da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffd27a_256x240.png":"dda1b6f694b0d196aefc66a1d6d758f6","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/actions_right.png":"31c8906bd25d27b83a0a2466bf903462","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ac-background.gif":"76135f3697b41a15aed787cfd77776c7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-square.gif":"16ea9a497d72f5e66e4e8ea9ae08024e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item.gif":"719fe2d4566108e73162fb8868d3778c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable.gif":"63a3351ea0d580797c9b8c386aa4f48b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable.gif":"a2d1af4128e4a798a7f3390b12a28574","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item-last.gif":"2ae7e1d9972ce71e5caa65a086bc5b7e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable-last.gif":"71acaa9d7c2616e9e8b7131a75ca65da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable-last.gif":"9d51036b3a8102742709da66789fd0f7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/red-header.gif":"c73b8765f0c8c3c183cb6a0c2bb0ec69","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-header.gif":"0e22a09bb8051b2a274b3427ede62e82","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/orange-header.gif":"ce1f93f0af64431771b4cbd6c99c567b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/calendar.png":"ab56e59af3c96ca661821257d376465e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/truncated.png":"c6f91108afe8159d417b4dc556cd3b2a","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/plus.gif":"f00e1e6e1161f48608bb2bbc79b9948c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/minus.gif":"6d77c0c0c2f86b6995d1cdf78274eaab","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/full-screen.png":"b541fadd3f1563856a4b44aeebd9d563","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/indicator.gif":"03ce3dcc84af110e9da8699a841e5200","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/delete.png":"93c047549c31a270a037840277cf59d3","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/bg.gif":"a315146ab814c73632480136576cd271","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/desc.gif":"0f58b33929095ea17795dd53bbced5d9","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/info-mini.png":"445c090ed777c5e6a08ac390fa896193","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ok.png":"f6973773335fd83d8d2875f9a3c925af","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/error.png":"1af8a1041016f67669c5fd22dc88c82e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-555.png":"9940f4e5b1248042c238e1924359fd5e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-555.png":"6ad3b0bae791bf61addc9d8ca80a642d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-fff.png":"b7db2402d4d5c72314c25790a66150d4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-fff.png":"f9be7454dbb47b0e0bca3aa370ae7db5","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/breadcrumb-separator.png":"1e7e50a8f573e230cf1e0f0399c516e8"},"utility_imports":[]}
+=== SIGNATURE END ===
+*/
+====CSSCOMPILEDCONTENT====
\ No newline at end of file
diff --git a/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_varchanged.css b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_varchanged.css
new file mode 100644
index 000000000..870e05159
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/main_varchanged.css
@@ -0,0 +1,6 @@
+/*
+=== SIGNATURE BEGIN ===
+{"variables":"8100523d2e76a70266f3e7110e2fe5fb","stylesheets":{"jqueryui":"78cfafc3524dac98e61fc2460918d4e5","main":"52d8a7c5530ceb3a4d777364fa4e1eea"},"variable_imports":{"css-variables":"MD5SUM"},"images":{"tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_222222_256x240.png":"3a3c5468f484f07ac4a320d9e22acb8c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_20_666666_40x40.png":"4429d568c67d8dfeb9040273ea0fb8c4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_E87C1E_256x240.png":"7003dd36cb2aa032c8ec871ce4d4e03d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_1c94c4_256x240.png":"dbd693dc8e0ef04e90a2f7ac7b390086","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_F26522_256x240.png":"16278ec0c07270be571f4c2e97fcc10c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-bg_diagonals-thick_18_b81900_40x40.png":"e460a66d4b3e093fc651e62a236267cb","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffffff_256x240.png":"41612b0f4a034424f8321c9f824a94da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/css\/ui-lightness\/images\/ui-icons_ffd27a_256x240.png":"dda1b6f694b0d196aefc66a1d6d758f6","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/actions_right.png":"31c8906bd25d27b83a0a2466bf903462","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ac-background.gif":"76135f3697b41a15aed787cfd77776c7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-square.gif":"16ea9a497d72f5e66e4e8ea9ae08024e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item.gif":"719fe2d4566108e73162fb8868d3778c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable.gif":"63a3351ea0d580797c9b8c386aa4f48b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable.gif":"a2d1af4128e4a798a7f3390b12a28574","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-item-last.gif":"2ae7e1d9972ce71e5caa65a086bc5b7e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-collapsable-last.gif":"71acaa9d7c2616e9e8b7131a75ca65da","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/tv-expandable-last.gif":"9d51036b3a8102742709da66789fd0f7","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/red-header.gif":"c73b8765f0c8c3c183cb6a0c2bb0ec69","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/green-header.gif":"0e22a09bb8051b2a274b3427ede62e82","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/orange-header.gif":"ce1f93f0af64431771b4cbd6c99c567b","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/calendar.png":"ab56e59af3c96ca661821257d376465e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/truncated.png":"c6f91108afe8159d417b4dc556cd3b2a","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/plus.gif":"f00e1e6e1161f48608bb2bbc79b9948c","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/minus.gif":"6d77c0c0c2f86b6995d1cdf78274eaab","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/full-screen.png":"b541fadd3f1563856a4b44aeebd9d563","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/indicator.gif":"03ce3dcc84af110e9da8699a841e5200","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/delete.png":"93c047549c31a270a037840277cf59d3","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/bg.gif":"a315146ab814c73632480136576cd271","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/desc.gif":"0f58b33929095ea17795dd53bbced5d9","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/info-mini.png":"445c090ed777c5e6a08ac390fa896193","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/ok.png":"f6973773335fd83d8d2875f9a3c925af","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/error.png":"1af8a1041016f67669c5fd22dc88c82e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-555.png":"9940f4e5b1248042c238e1924359fd5e","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-555.png":"6ad3b0bae791bf61addc9d8ca80a642d","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-open-fff.png":"b7db2402d4d5c72314c25790a66150d4","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/eye-closed-fff.png":"f9be7454dbb47b0e0bca3aa370ae7db5","tests\/php-unit-tests\/unitary-tests\/application\/theme-handler\/copied\/testimages\/images\/breadcrumb-separator.png":"1e7e50a8f573e230cf1e0f0399c516e8"},"utility_imports":[]}
+=== SIGNATURE END ===
+*/
+====CSSCOMPILEDCONTENT====
\ No newline at end of file
diff --git a/test/application/theme-handler/expected/themes/basque-red/theme-parameters.json b/tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/theme-parameters.json
similarity index 100%
rename from test/application/theme-handler/expected/themes/basque-red/theme-parameters.json
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/expected/themes/basque-red/theme-parameters.json
diff --git a/test/application/theme-handler/getimages/expected-getimages.json b/tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/expected-getimages.json
similarity index 100%
rename from test/application/theme-handler/getimages/expected-getimages.json
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/expected-getimages.json
diff --git a/test/application/theme-handler/getimages/test-getimages.scss b/tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/test-getimages.scss
similarity index 100%
rename from test/application/theme-handler/getimages/test-getimages.scss
rename to tests/php-unit-tests/unitary-tests/application/theme-handler/getimages/test-getimages.scss
diff --git a/test/application/UtilsTest.php b/tests/php-unit-tests/unitary-tests/application/utilsTest.php
similarity index 99%
rename from test/application/UtilsTest.php
rename to tests/php-unit-tests/unitary-tests/application/utilsTest.php
index 1e207d980..ef262e3ae 100644
--- a/test/application/UtilsTest.php
+++ b/tests/php-unit-tests/unitary-tests/application/utilsTest.php
@@ -24,7 +24,7 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
/**
* @covers utils
*/
-class UtilsTest extends ItopTestCase
+class utilsTest extends ItopTestCase
{
public function testEndsWith()
{
diff --git a/test/core/ActionEmailTest.php b/tests/php-unit-tests/unitary-tests/core/ActionEmailTest.php
similarity index 100%
rename from test/core/ActionEmailTest.php
rename to tests/php-unit-tests/unitary-tests/core/ActionEmailTest.php
diff --git a/test/core/AttributeDefTest.inc.php b/tests/php-unit-tests/unitary-tests/core/AttributeDefTest.inc.php
similarity index 100%
rename from test/core/AttributeDefTest.inc.php
rename to tests/php-unit-tests/unitary-tests/core/AttributeDefTest.inc.php
diff --git a/test/core/AttributeURLDefaultPattern.php b/tests/php-unit-tests/unitary-tests/core/AttributeURLDefaultPattern.php
similarity index 100%
rename from test/core/AttributeURLDefaultPattern.php
rename to tests/php-unit-tests/unitary-tests/core/AttributeURLDefaultPattern.php
diff --git a/test/core/AttributeURLTest.php b/tests/php-unit-tests/unitary-tests/core/AttributeURLTest.php
similarity index 93%
rename from test/core/AttributeURLTest.php
rename to tests/php-unit-tests/unitary-tests/core/AttributeURLTest.php
index 08d183199..bd257d629 100644
--- a/test/core/AttributeURLTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/AttributeURLTest.php
@@ -14,8 +14,8 @@ class AttributeURLTest extends ItopTestCase {
public function setUp(): void
{
parent::setUp();
- require_once APPROOT.'core/attributedef.class.inc.php';
- require_once APPROOT.'test/core/AttributeURLDefaultPattern.php';
+ $this->RequireOnceItopFile('core/attributedef.class.inc.php');
+ $this->RequireOnceUnitTestFile('./AttributeURLDefaultPattern.php');
}
/**
diff --git a/test/core/BulkChangeTest.inc.php b/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php
similarity index 99%
rename from test/core/BulkChangeTest.inc.php
rename to tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php
index 9d2dd1b99..ec944796e 100644
--- a/test/core/BulkChangeTest.inc.php
+++ b/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php
@@ -17,7 +17,7 @@ class BulkChangeTest extends ItopDataTestCase {
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/bulkchange.class.inc.php');
+ $this->RequireOnceItopFile('core/bulkchange.class.inc.php');
}
diff --git a/test/core/CMDBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBObjectTest.php
similarity index 100%
rename from test/core/CMDBObjectTest.php
rename to tests/php-unit-tests/unitary-tests/core/CMDBObjectTest.php
diff --git a/test/core/CMDBSource/CMDBSourceTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php
similarity index 98%
rename from test/core/CMDBSource/CMDBSourceTest.php
rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php
index 588c8dac7..7ac4451db 100644
--- a/test/core/CMDBSource/CMDBSourceTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php
@@ -25,7 +25,7 @@ class CMDBSourceTest extends ItopTestCase
{
parent::setUp();
- require_once(APPROOT.'/core/cmdbsource.class.inc.php');
+ $this->RequireOnceItopFile('/core/cmdbsource.class.inc.php');
}
/**
diff --git a/test/core/CMDBSource/DeadLockInjection.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php
similarity index 100%
rename from test/core/CMDBSource/DeadLockInjection.php
rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php
diff --git a/test/core/CMDBSource/TransactionsTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php
similarity index 99%
rename from test/core/CMDBSource/TransactionsTest.php
rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php
index 8882ab59f..c3afb8681 100644
--- a/test/core/CMDBSource/TransactionsTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php
@@ -33,7 +33,7 @@ class TransactionsTest extends ItopTestCase
{
parent::setUp();
require_once('DeadLockInjection.php');
- require_once(APPROOT.'/core/cmdbsource.class.inc.php');
+ $this->RequireOnceItopFile('/core/cmdbsource.class.inc.php');
$sEnv = 'production';
$sConfigFile = APPCONF.$sEnv.'/config-itop.php';
diff --git a/test/core/CSVParserTest.php b/tests/php-unit-tests/unitary-tests/core/CSVParserTest.php
similarity index 100%
rename from test/core/CSVParserTest.php
rename to tests/php-unit-tests/unitary-tests/core/CSVParserTest.php
diff --git a/test/core/ConfigPlaceholdersResolverTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php
similarity index 98%
rename from test/core/ConfigPlaceholdersResolverTest.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php
index 0e99c5623..20112b23f 100644
--- a/test/core/ConfigPlaceholdersResolverTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php
@@ -34,7 +34,7 @@ class ConfigPlaceholdersResolverTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/config.class.inc.php');
+ $this->RequireOnceItopFile('core/config.class.inc.php');
}
/**
* @dataProvider providerResolve
diff --git a/test/core/ConfigTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigTest.php
similarity index 98%
rename from test/core/ConfigTest.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigTest.php
index 77026e81d..1ed14a82c 100644
--- a/test/core/ConfigTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/ConfigTest.php
@@ -34,7 +34,7 @@ class ConfigTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/config.class.inc.php');
+ $this->RequireOnceItopFile('core/config.class.inc.php');
}
/**
diff --git a/test/core/ConfigTest/config-itop-joker.php b/tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php
similarity index 100%
rename from test/core/ConfigTest/config-itop-joker.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php
diff --git a/test/core/ConfigTest/config-itop-var.php b/tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php
similarity index 100%
rename from test/core/ConfigTest/config-itop-var.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php
diff --git a/test/core/ConfigValidator/config-itop_KO_config_plus_code.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php
similarity index 100%
rename from test/core/ConfigValidator/config-itop_KO_config_plus_code.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php
diff --git a/test/core/ConfigValidator/config-itop_KO_function.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php
similarity index 100%
rename from test/core/ConfigValidator/config-itop_KO_function.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php
diff --git a/test/core/ConfigValidator/config-itop_VALID.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php
similarity index 100%
rename from test/core/ConfigValidator/config-itop_VALID.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php
diff --git a/test/core/ConfigValidator/config-itop_VALID_log-level-min_const.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php
similarity index 100%
rename from test/core/ConfigValidator/config-itop_VALID_log-level-min_const.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php
diff --git a/test/core/ConfigValidator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php
similarity index 90%
rename from test/core/ConfigValidator/iTopConfigAstValidatorTest.php
rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php
index b30b67f14..5c64b2ea2 100644
--- a/test/core/ConfigValidator/iTopConfigAstValidatorTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php
@@ -15,8 +15,8 @@ class iTopConfigAstValidatorTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once APPROOT.'env-production/itop-config/src/Validator/iTopConfigAstValidator.php';
- require_once APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php';
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/iTopConfigAstValidator.php');
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/ConfigNodesVisitor.php');
}
public function testValidateFileValid()
diff --git a/test/core/DBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php
similarity index 99%
rename from test/core/DBObjectTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBObjectTest.php
index 752ee47e9..f0d94af37 100644
--- a/test/core/DBObjectTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php
@@ -45,7 +45,7 @@ class DBObjectTest extends ItopDataTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/dbobject.class.php');
+ $this->RequireOnceItopFile('core/dbobject.class.php');
}
/**
diff --git a/test/core/DBSearchAddConditionPointingTo.php b/tests/php-unit-tests/unitary-tests/core/DBSearchAddConditionPointingTo.php
similarity index 100%
rename from test/core/DBSearchAddConditionPointingTo.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchAddConditionPointingTo.php
diff --git a/test/core/DBSearchCommitTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php
similarity index 100%
rename from test/core/DBSearchCommitTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php
diff --git a/test/core/DBSearchIntersectTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php
similarity index 99%
rename from test/core/DBSearchIntersectTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php
index 55c4fba52..5cb13ed19 100644
--- a/test/core/DBSearchIntersectTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php
@@ -22,7 +22,7 @@ class DBSearchIntersectTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'application/startup.inc.php');
+ $this->RequireOnceItopFile('application/startup.inc.php');
}
/**
diff --git a/test/core/DBSearchJoinTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php
similarity index 99%
rename from test/core/DBSearchJoinTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php
index e9eb96585..468c9ef92 100644
--- a/test/core/DBSearchJoinTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php
@@ -23,7 +23,7 @@ class DBSearchJoinTest extends ItopDataTestCase {
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'application/startup.inc.php');
+ $this->RequireOnceItopFile('application/startup.inc.php');
}
/**
diff --git a/test/core/DBSearchTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php
similarity index 99%
rename from test/core/DBSearchTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchTest.php
index dded9f97b..4dbf13664 100644
--- a/test/core/DBSearchTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php
@@ -58,8 +58,8 @@ class DBSearchTest extends ItopDataTestCase
{
parent::setUp();
- require_once(APPROOT.'application/itopwebpage.class.inc.php');
- require_once(APPROOT.'application/displayblock.class.inc.php');
+ $this->RequireOnceItopFile('application/itopwebpage.class.inc.php');
+ $this->RequireOnceItopFile('application/displayblock.class.inc.php');
}
/**
diff --git a/test/core/DBSearchUpdateRealiasingMapTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php
similarity index 97%
rename from test/core/DBSearchUpdateRealiasingMapTest.php
rename to tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php
index 7187e466d..4fd6a3ace 100644
--- a/test/core/DBSearchUpdateRealiasingMapTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php
@@ -22,7 +22,7 @@ class DBSearchUpdateRealiasingMapTest extends ItopDataTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'application/startup.inc.php');
+ $this->RequireOnceItopFile('application/startup.inc.php');
}
/**
diff --git a/test/core/ExpressionEvaluateTest.php b/tests/php-unit-tests/unitary-tests/core/ExpressionEvaluateTest.php
similarity index 100%
rename from test/core/ExpressionEvaluateTest.php
rename to tests/php-unit-tests/unitary-tests/core/ExpressionEvaluateTest.php
diff --git a/test/core/ExpressionTest.php b/tests/php-unit-tests/unitary-tests/core/ExpressionTest.php
similarity index 100%
rename from test/core/ExpressionTest.php
rename to tests/php-unit-tests/unitary-tests/core/ExpressionTest.php
diff --git a/test/core/GetSelectFilterTest.php b/tests/php-unit-tests/unitary-tests/core/GetSelectFilterTest.php
similarity index 100%
rename from test/core/GetSelectFilterTest.php
rename to tests/php-unit-tests/unitary-tests/core/GetSelectFilterTest.php
diff --git a/test/core/InlineImageTest.php b/tests/php-unit-tests/unitary-tests/core/InlineImageTest.php
similarity index 100%
rename from test/core/InlineImageTest.php
rename to tests/php-unit-tests/unitary-tests/core/InlineImageTest.php
diff --git a/test/core/Log/ExceptionLogTest.php b/tests/php-unit-tests/unitary-tests/core/Log/ExceptionLogTest.php
similarity index 100%
rename from test/core/Log/ExceptionLogTest.php
rename to tests/php-unit-tests/unitary-tests/core/Log/ExceptionLogTest.php
diff --git a/test/core/Log/ExceptionLogTest/Exceptions.php b/tests/php-unit-tests/unitary-tests/core/Log/ExceptionLogTest/Exceptions.php
similarity index 100%
rename from test/core/Log/ExceptionLogTest/Exceptions.php
rename to tests/php-unit-tests/unitary-tests/core/Log/ExceptionLogTest/Exceptions.php
diff --git a/test/core/Log/LogAPITest.php b/tests/php-unit-tests/unitary-tests/core/Log/LogAPITest.php
similarity index 100%
rename from test/core/Log/LogAPITest.php
rename to tests/php-unit-tests/unitary-tests/core/Log/LogAPITest.php
diff --git a/test/core/Log/LogFileNameBuilderTest.php b/tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php
similarity index 100%
rename from test/core/Log/LogFileNameBuilderTest.php
rename to tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php
diff --git a/tests/php-unit-tests/unitary-tests/core/LogAPITest.php b/tests/php-unit-tests/unitary-tests/core/LogAPITest.php
new file mode 100644
index 000000000..7f253ddf9
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/core/LogAPITest.php
@@ -0,0 +1,143 @@
+mockFileLog = $this->createMock('FileLog');
+ $this->oMetaModelConfig = $this->createMock('Config');
+ }
+
+
+ /**
+ * @dataProvider LogApiProvider
+ * @test
+ * @backupGlobals disabled
+ */
+ public function TestLogApi($oConfigObject, $sMessage, $Channel, $sExpectedLevel, $sExpectedMessage, $sExpectedChannel = '')
+ {
+ \IssueLog::MockStaticObjects($this->mockFileLog, $oConfigObject);
+
+ $this->mockFileLog->expects($this->exactly(1))
+ ->method($sExpectedLevel)
+ ->with($sExpectedMessage, $sExpectedChannel);
+
+ \IssueLog::Error($sMessage, $Channel);
+ }
+
+ public function LogApiProvider()
+ {
+ return [
+ [ $this->oMetaModelConfig, "log msg", '' , "Error", "log msg"],
+ [ $this->oMetaModelConfig, "log msg", 'PoudlardChannel' , "Error", "log msg", 'PoudlardChannel'],
+ [ array(), "log msg", '' , "Error", "log msg"], // Bruno?
+ ];
+ }
+
+ /**
+ * @dataProvider LogWarningWithASpecificChannelProvider
+ * @test
+ * @backupGlobals disabled
+ */
+ public function TestLogWarningWithASpecificChannel($expectedCallNb, $sExpectedLevel, $ConfigReturnedObject, $bExceptionRaised=false)
+ {
+ $this->oMetaModelConfig
+ ->method("Get")
+ ->with('log_level_min')
+ ->willReturn($ConfigReturnedObject);
+
+ \IssueLog::MockStaticObjects($this->mockFileLog, $this->oMetaModelConfig);
+
+ $this->mockFileLog->expects($this->exactly($expectedCallNb))
+ ->method($sExpectedLevel)
+ ->with("log msg", "GaBuZoMeuChannel");
+
+ try{
+ \IssueLog::Warning("log msg", "GaBuZoMeuChannel");
+ if ($bExceptionRaised)
+ {
+ $this->fail("raised should have been raised");
+ }
+ }
+ catch(\Exception $e)
+ {
+ if (!$bExceptionRaised)
+ {
+ $this->fail("raised should NOT have been raised");
+ }
+ }
+ }
+
+ public function LogWarningWithASpecificChannelProvider()
+ {
+ return [
+ "empty config" => [ 0, "Ok", ''],
+ "Default Unknown Level" => [ 0, "Ok", 'TotoLevel', true],
+ "Info as Default Level" => [ 1 , "Warning", 'Info'],
+ "Error as Default Level" => [ 0, "Warning", 'Error'],
+ "Empty array" => [ 0, "Ok", array()],
+ "Channel configured on an undefined level" => [ 0, "Ok", ["GaBuZoMeuChannel" => "TotoLevel"], true],
+ "Channel defined with Error" => [ 0, "Warning", ["GaBuZoMeuChannel" => "Error"]],
+ "Channel defined with Info" => [ 1, "Warning", ["GaBuZoMeuChannel" => "Info"]],
+ ];
+ }
+
+ /**
+ * @dataProvider LogOkWithASpecificChannel
+ * @test
+ * @backupGlobals disabled
+ */
+ public function TestLogOkWithASpecificChannel($expectedCallNb, $sExpectedLevel, $ConfigReturnedObject, $bExceptionRaised=false)
+ {
+ $this->oMetaModelConfig
+ ->method("Get")
+ ->with('log_level_min')
+ ->willReturn($ConfigReturnedObject);
+
+ \IssueLog::MockStaticObjects($this->mockFileLog, $this->oMetaModelConfig);
+
+ $this->mockFileLog->expects($this->exactly($expectedCallNb))
+ ->method($sExpectedLevel)
+ ->with("log msg", "GaBuZoMeuChannel");
+
+ try{
+ \IssueLog::Ok("log msg", "GaBuZoMeuChannel");
+ if ($bExceptionRaised)
+ {
+ $this->fail("raised should have been raised");
+ }
+ }
+ catch(\Exception $e)
+ {
+ if (!$bExceptionRaised)
+ {
+ $this->fail("raised should NOT have been raised");
+ }
+ }
+ }
+
+ public function LogOkWithASpecificChannel()
+ {
+ return [
+ "empty config" => [ 1, "Ok", ''],
+ "Empty array" => [ 1, "Ok", array()],
+ ];
+ }
+
+}
diff --git a/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php b/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php
new file mode 100644
index 000000000..882b04296
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php
@@ -0,0 +1,160 @@
+getTimestamp());
+ clearstatcache(true, $sLogFile);
+ }
+
+ protected function setUp(): void
+ {
+ parent::setUp();
+
+ $this->RequireOnceItopFile('core/log.class.inc.php');
+ }
+
+ protected function tearDown(): void
+ {
+ parent::tearDown();
+
+ // remove log files created in the test
+ $aTestLogFiles = glob(__DIR__.DIRECTORY_SEPARATOR.self::TEST_LOGFILE_PREFIX.'*.'.self::TEST_LOGFILE_EXTENSION);
+ foreach ($aTestLogFiles as $sLogFile) {
+ unlink($sLogFile);
+ }
+ }
+
+ public function testCheckAndRotateLogFile()
+ {
+ $sLogFile = __DIR__.DIRECTORY_SEPARATOR.self::TEST_LOGFILE_PREFIX.'.'.self::TEST_LOGFILE_EXTENSION;
+ $oFileBuilder = new DailyRotatingLogFileNameBuilder($sLogFile);
+
+ if (file_exists($sLogFile))
+ {
+ unlink($sLogFile);
+ }
+
+ $bIsFileExists = $oFileBuilder->IsLogFileExists();
+ $this->assertFalse($bIsFileExists, 'Test log file does not exist');
+
+ $hLogFile = fopen($sLogFile, 'a');
+ $sDate = date('Y-m-d H:i:s');
+ $sTestClassName = self::class;
+ fwrite($hLogFile, "$sDate | This is a line generated by $sTestClassName\n");
+ fclose($hLogFile);
+ $iLogDateLastModifiedTimeStamp = filemtime($sLogFile);
+ $oLogFileLastModified = DateTime::createFromFormat('U', $iLogDateLastModifiedTimeStamp);
+
+ $sRotatedLogFile = $oFileBuilder->GetRotatedFileName($oLogFileLastModified);
+ $oFileBuilder->CheckAndRotateLogFile();
+ $this->assertFileExists($sLogFile, 'Test log file modification date is today, original file still exists after rotation call');
+ $this->assertFileNotExists($sRotatedLogFile, 'No rotation occurred yet');
+
+ $oTimeYesterday = new DateTime('yesterday');
+ $sRotatedLogFile = $oFileBuilder->GetRotatedFileName($oTimeYesterday);
+ $this->ChangeFileModificationDate($sLogFile, $oTimeYesterday);
+
+ // changing modification date, but do not reset cached filebuilder date => no change
+ $oFileBuilder->CheckAndRotateLogFile();
+ $this->assertFileExists($sLogFile, 'Test log file modification date is yesterday but filebuilder use its cache, original file still exists after rotation call');
+ $this->assertFileNotExists($sRotatedLogFile, 'No rotation occurred yet');
+
+ // changing modification date AND resetting filebuilder date cache
+ $oFileBuilder->ResetLastModifiedDateForFile();
+ $oFileBuilder->CheckAndRotateLogFile();
+ $this->assertFileNotExists($sLogFile, 'Test log file modification date is yesterday, file rotated !');
+ $this->assertFileExists($sRotatedLogFile, 'Rotation was done');
+
+ // file cleanup will be done in tearDown !
+ }
+
+ public function ShouldRotateProvider()
+ {
+ return array(
+ 'DAILY Same day' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-01 15:42', false),
+ 'DAILY Same week, different day less 24h diff' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 12:00', '2020-02-02 09:00', true),
+ 'DAILY Same week, different day' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-02 00:00', true),
+ 'DAILY 1 week diff' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-08 00:00', true),
+ 'WEEKLY Same week' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-01 00:00', false),
+ 'WEEKLY 1 week diff, same month' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-08 00:00', true),
+ 'WEEKLY 2 weeks diff, same month' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-15 00:00', true),
+ 'WEEKLY 1 week diff, different month' => array('WeeklyRotatingLogFileNameBuilder', '2020-01-27 00:00', '2020-02-03 00:00', true),
+ 'WEEKLY same week, different month' => array('WeeklyRotatingLogFileNameBuilder', '2020-01-27 00:00', '2020-02-02 00:00', false),
+ 'WEEKLY 1 week diff, different year' => array('WeeklyRotatingLogFileNameBuilder', '2019-12-30 00:00', '2020-01-06 00:00', true),
+ 'WEEKLY same week, different year' => array('WeeklyRotatingLogFileNameBuilder', '2019-12-30 00:00', '2020-01-05 00:00', true),
+ 'MONTHLY same month' => array('MonthlyRotatingLogFileNameBuilder', '2020-02-10 00:00', '2020-02-14 00:00', false),
+ 'MONTHLY on first day which is a sunday' => array('MonthlyRotatingLogFileNameBuilder', '2020-01-30 00:00', '2020-02-01 00:00', true),
+ );
+ }
+
+ /**
+ * @param string $sFileNameBuilderClass RotatingLogFileNameBuilder impl
+ * @param string $sDateModified format Y-m-d H:i
+ * @param string $sDateNow format Y-m-d H:i
+ * @param bool $bExpected
+ *
+ * @dataProvider ShouldRotateProvider
+ */
+ public function testShouldRotate($sFileNameBuilderClass, $sDateModified, $sDateNow, $bExpected)
+ {
+ $oDateModified = DateTime::createFromFormat('Y-m-d H:i', $sDateModified);
+ $oDateNow = DateTime::createFromFormat('Y-m-d H:i', $sDateNow);
+
+ /** @var \RotatingLogFileNameBuilder $oFileBuilder */
+ $oFileBuilder = new $sFileNameBuilderClass();
+ $bShouldRotate = $oFileBuilder->ShouldRotate($oDateModified, $oDateNow);
+
+ $this->assertEquals($bExpected, $bShouldRotate);
+ }
+
+ public function CronNextOccurrenceProvider()
+ {
+ return array(
+ 'DAILY morning' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 05:00', '2020-02-02 00:00'),
+ 'DAILY midnight' => array('DailyRotatingLogFileNameBuilder', '2020-02-01 00:00', '2020-02-02 00:00'),
+ 'WEEKLY monday 12:42' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-03 12:42', '2020-02-10 00:00'),
+ 'WEEKLY monday 00:00' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-03 00:00', '2020-02-10 00:00'),
+ 'WEEKLY tuesday 12:42' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-04 12:42', '2020-02-10 00:00'),
+ 'WEEKLY sunday 12:42' => array('WeeklyRotatingLogFileNameBuilder', '2020-02-02 12:42', '2020-02-03 00:00'),
+ 'MONTHLY 12/02 12:42' => array('MonthlyRotatingLogFileNameBuilder', '2020-02-12 12:42', '2020-03-01 00:00'),
+ );
+ }
+
+ /**
+ * @param string $sFileNameBuilderClass RotatingLogFileNameBuilder impl
+ * @param string $sDateNow format Y-m-d H:i
+ * @param string $sExpectedOccurrence format Y-m-d H:i
+ *
+ * @dataProvider CronNextOccurrenceProvider
+ */
+ public function testCronNextOccurrence($sFileNameBuilderClass, $sDateNow, $sExpectedOccurrence)
+ {
+ $oDateNow = DateTime::createFromFormat('Y-m-d H:i', $sDateNow);
+
+ /** @var \RotatingLogFileNameBuilder $oFileBuilder */
+ $oFileBuilder = new $sFileNameBuilderClass();
+ $oActualOccurrence = $oFileBuilder->GetCronProcessNextOccurrence($oDateNow);
+ $sActualOccurrence = $oActualOccurrence->format('Y-m-d H:i');
+
+ $this->assertEquals($sExpectedOccurrence, $sActualOccurrence);
+ }
+}
\ No newline at end of file
diff --git a/test/core/MetaModelTest.php b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php
similarity index 99%
rename from test/core/MetaModelTest.php
rename to tests/php-unit-tests/unitary-tests/core/MetaModelTest.php
index 02b5c2622..3a9b860cc 100644
--- a/test/core/MetaModelTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php
@@ -27,7 +27,7 @@ class MetaModelTest extends ItopDataTestCase
protected function setUp(): void
{
parent::setUp();
- require_once APPROOT.'/core/metamodel.class.php';
+ $this->RequireOnceItopFile('/core/metamodel.class.php');
}
/**
diff --git a/test/core/OQLParserTest.php b/tests/php-unit-tests/unitary-tests/core/OQLParserTest.php
similarity index 100%
rename from test/core/OQLParserTest.php
rename to tests/php-unit-tests/unitary-tests/core/OQLParserTest.php
diff --git a/tests/php-unit-tests/unitary-tests/core/OQLTest.php b/tests/php-unit-tests/unitary-tests/core/OQLTest.php
new file mode 100644
index 000000000..c6f71058b
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/core/OQLTest.php
@@ -0,0 +1,507 @@
+Set('use_legacy_dbsearch', false, 'test');
+ utils::GetConfig()->Set('apc_cache.enabled', false, 'test');
+ utils::GetConfig()->Set('query_cache_enabled', false, 'test');
+ utils::GetConfig()->Set('expression_cache_enabled', false, 'test');
+ $sConfigFile = utils::GetConfig()->GetLoadedFile();
+ @chmod($sConfigFile, 0770);
+ utils::GetConfig()->WriteToFile();
+ @chmod($sConfigFile, 0444); // Read-only
+ }
+
+ /**
+ * @dataProvider NestedQueryProvider
+ * @depends testOQLSetup
+ *
+ * @param $sQuery
+ *
+ * @throws \OQLException
+ */
+ public function testGoodNestedQueryQueryParser($sQuery)
+ {
+ $this->debug($sQuery);
+ $oOql = new OqlInterpreter($sQuery);
+ $oQuery = $oOql->ParseQuery();
+ static::assertInstanceOf('OqlQuery', $oQuery);
+ }
+
+ public function NestedQueryProvider()
+ {
+ return array(
+ array("SELECT User AS U JOIN Person AS P ON U.contactid = P.id WHERE U.status='enabled' AND U.id NOT IN (SELECT User AS U JOIN Person AS P ON U.contactid=P.id JOIN URP_UserOrg AS L ON L.userid = U.id WHERE U.status='enabled' AND L.allowed_org_id = P.org_id UNION SELECT User AS U WHERE U.status='enabled' AND U.id NOT IN ( SELECT User AS U JOIN URP_UserOrg AS L ON L.userid = U.id WHERE U.status='enabled'))"),
+ array('SELECT `UserRequest` FROM UserRequest AS `UserRequest` WHERE `UserRequest`.org_id IN (SELECT `Organization` FROM Organization AS `Organization` JOIN Organization AS `Organization1` ON `Organization`.parent_id BELOW `Organization1`.id WHERE (`Organization1`.`id` = \'3\'))'),
+ array('SELECT `UserRequest` FROM UserRequest AS `UserRequest` WHERE (`UserRequest`.`org_id` IN (SELECT `Organization` FROM Organization AS `Organization` WHERE `Organization`.`id`=`UserRequest`.`org_id`))'),
+ array("SELECT UserRequest AS Ur WHERE Ur.id NOT IN (SELECT UserRequest AS Ur JOIN lnkFunctionalCIToTicket AS lnk ON lnk.ticket_id = Ur.id)"),
+ array("SELECT Ticket AS T WHERE T. finalclass IN ('userrequest' , 'change') AND T.id NOT IN (SELECT UserRequest AS Ur JOIN lnkFunctionalCIToTicket AS lnk ON lnk.ticket_id = Ur.id UNION SELECT Change AS C JOIN lnkFunctionalCIToTicket AS lnk ON lnk.ticket_id = C.id)"),
+ array("SELECT PhysicalDevice WHERE status='production' AND id NOT IN (SELECT PhysicalDevice AS p JOIN lnkFunctionalCIToProviderContract AS l ON l.functionalci_id=p.id)"),
+ array("SELECT Team WHERE id NOT IN (SELECT Team AS t JOIN lnkPersonToTeam AS l ON l.team_id=t.id WHERE 1)"),
+ );
+ }
+
+ /**
+ * @dataProvider GoodQueryProvider
+ * @depends testOQLSetup
+ *
+ * @param $sQuery
+ *
+ * @throws \OQLException
+ */
+ public function testGoodQueryParser($sQuery)
+ {
+ $this->debug($sQuery);
+ $oOql = new OqlInterpreter($sQuery);
+ $oQuery = $oOql->ParseQuery();
+ static::assertInstanceOf('OqlQuery', $oQuery);
+ }
+
+ public function GoodQueryProvider()
+ {
+ return array(
+ array('SELECT toto'),
+ array('SELECT toto WHERE toto.a = 1'),
+ array('SELECT toto WHERE toto.a = -1'),
+ array('SELECT toto WHERE toto.a = (1-1)'),
+ array('SELECT toto WHERE toto.a = (-1+3)'),
+ array('SELECT toto WHERE toto.a = (3+-1)'),
+ array('SELECT toto WHERE toto.a = (3--1)'),
+ array('SELECT toto WHERE toto.a = 0xC'),
+ array('SELECT toto WHERE toto.a = \'AXDVFS0xCZ32\''),
+ array('SELECT toto WHERE toto.a = :myparameter'),
+ array('SELECT toto WHERE toto.a IN (:param1)'),
+ array('SELECT toto WHERE toto.a IN (:param1, :param2)'),
+ array('SELECT toto WHERE toto.a=1'),
+ array('SELECT toto WHERE toto.a = "1"'),
+ array('SELECT toto WHERE toto.a & 1'),
+ array('SELECT toto WHERE toto.a | 1'),
+ array('SELECT toto WHERE toto.a ^ 1'),
+ array('SELECT toto WHERE toto.a << 1'),
+ array('SELECT toto WHERE toto.a >> 1'),
+ array('SELECT toto WHERE toto.a NOT LIKE "That\'s it"'),
+ array('SELECT toto WHERE toto.a NOT LIKE "That\'s \\"it\\""'),
+ array('SELECT toto WHERE toto.a NOT LIKE \'That"s it\''),
+ array('SELECT toto WHERE toto.a NOT LIKE \'That\\\'s it\''),
+ array('SELECT toto WHERE toto.a NOT LIKE "blah \\\\ truc"'),
+ array('SELECT toto WHERE toto.a NOT LIKE \'blah \\\\ truc\''),
+ array('SELECT toto WHERE toto.a NOT LIKE "\\\\"'),
+ array('SELECT toto WHERE toto.a NOT LIKE "\\""'),
+ array('SELECT toto WHERE toto.a NOT LIKE "\\"\\\\"'),
+ array('SELECT toto WHERE toto.a NOT LIKE "\\\\\\""'),
+ array('SELECT toto WHERE toto.a NOT LIKE ""'),
+ array('SELECT toto WHERE toto.a NOT LIKE "blah" AND toto.b LIKE "foo"'),
+ array('SELECT toto WHERE toto.a = 1 AND toto.b LIKE "x" AND toto.f >= 12345'),
+ array('SELECT Device JOIN Site ON Device.site = Site.id'),
+ array('SELECT Device JOIN Site ON Device.site = Site.id JOIN Country ON Site.location = Country.id'),
+ array('SELECT UserRightsMatrixClassGrant WHERE UserRightsMatrixClassGrant.class = \'lnkContactRealObject\' AND UserRightsMatrixClassGrant.action = \'modify\' AND UserRightsMatrixClassGrant.login = \'Denis\''),
+ array('SELECT A WHERE A.col1 = \'lit1\' AND A.col2 = \'lit2\' AND A.col3 = \'lit3\''),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE (A.col1 = 123 AND B.col1 = \'aa\') OR (A.col3 = \'zzz\' AND B.col4 > 100)'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE (A.col1 = B.col2 AND B.col1 = A.col2) OR (A.col3 = \'\' AND B.col4 > 100)'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE A.col1 + B.col2 * B.col1 = A.col2'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE A.col1 + (B.col2 * B.col1) = A.col2'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE (A.col1 + B.col2) * B.col1 = A.col2'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE (A.col1 & B.col2) = A.col2'),
+ array('SELECT Device AS D_ JOIN Site AS S_ ON D_.site = S_.id WHERE S_.country = "Francia"'),
+ array('SELECT A FROM A'),
+ array('SELECT A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT A FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT B FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT A,B FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT A, B FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT B,A FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT A, B,C FROM A JOIN B ON A.myB = B.id'),
+ array('SELECT C FROM A JOIN B ON A.myB = B.id WHERE A.col1 = 2'),
+ array('SELECT A JOIN B ON A.myB BELOW B.id WHERE A.col1 = 2'),
+ array('SELECT A JOIN B ON B.myA BELOW A.id WHERE A.col1 = 2'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id BELOW B.id WHERE A.col1 = 2 AND B.id = 3'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id BELOW STRICT B.id WHERE A.col1 = 2 AND B.id = 3'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id NOT BELOW B.id WHERE A.col1 = 2 AND B.id = 3'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id NOT BELOW STRICT B.id WHERE A.col1 = 2 AND B.id = 3'),
+ array('SELECT A UNION SELECT B'),
+ array('SELECT A WHERE A.b = "sdf" UNION SELECT B WHERE B.a = "sfde"'),
+ array('SELECT A UNION SELECT B UNION SELECT C'),
+ array('SELECT A UNION SELECT B UNION SELECT C UNION SELECT D'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id NOT BELOW B.id WHERE A.col1 = 2 AND B.id = 3 UNION SELECT Device JOIN Site ON Device.site = Site.id JOIN Country ON Site.location = Country.id'),
+ array('SELECT Person AS B WHERE B.name LIKE \'%A%\''),
+ array('SELECT Server WHERE name REGEXP \'dbserver[0-9]+\''),
+ array('SELECT Server WHERE name REGEXP \'^dbserver[0-9]+\\\\..+\\\\.[a-z]{2,3}$\''),
+ array('SELECT Change AS ch WHERE ch.start_date >= \'2009-12-31\' AND ch.end_date <= \'2010-01-01\''),
+ array('SELECT DatacenterDevice AS dev WHERE INET_ATON(dev.managementip) > INET_ATON(\'10.22.32.224\') AND INET_ATON(dev.managementip) < INET_ATON(\'10.22.32.255\')'),
+ array('SELECT Person AS P JOIN Organization AS Node ON P.org_id = Node.id JOIN Organization AS Root ON Node.parent_id BELOW Root.id WHERE Root.id=1'),
+ array('SELECT PhysicalInterface AS if JOIN DatacenterDevice AS dev ON if.connectableci_id = dev.id WHERE dev.status = \'production\' AND dev.organization_name = \'Demo\''),
+ array('SELECT Ticket AS t WHERE t.agent_id = :current_contact_id'),
+ array('SELECT Person AS p JOIN UserRequest AS u ON u.agent_id = p.id WHERE u.status != \'closed\''),
+ array('SELECT Contract AS c WHERE c.end_date > NOW() AND c.end_date < DATE_ADD(NOW(), INTERVAL 30 DAY)'),
+ array('SELECT UserRequest AS u WHERE u.start_date < DATE_SUB(NOW(), INTERVAL 60 MINUTE) AND u.status = \'new\''),
+ array('SELECT UserRequest AS u WHERE u.close_date > DATE_ADD(u.start_date, INTERVAL 8 HOUR)'),
+ array('SELECT Ticket WHERE tagfield MATCHES \'salad\''),
+ );
+ }
+
+ /**
+ * @dataProvider BadQueryProvider
+ * @depends testOQLSetup
+ *
+ * @param $sQuery
+ * @param $sExpectedExceptionClass
+ *
+ */
+ public function testBadQueryParser($sQuery, $sExpectedExceptionClass)
+ {
+ $this->debug($sQuery);
+ $oOql = new OqlInterpreter($sQuery);
+ $sExceptionClass = '';
+ try
+ {
+ $oOql->ParseQuery();
+ }
+ catch (Exception $e)
+ {
+ $sExceptionClass = get_class($e);
+ }
+
+ static::assertEquals($sExpectedExceptionClass, $sExceptionClass);
+ }
+
+ public function BadQueryProvider()
+ {
+ return array(
+ array('SELECT toto WHERE toto.a = (3++1)', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHHHERE toto.a = "1"', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHERE toto.a == "1"', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHERE toto.a % 1', 'Exception'),
+ array('SELECT toto WHERE toto.a like \'arg\'', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHERE toto.a NOT LIKE "That\'s "it""', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHERE toto.a NOT LIKE \'That\'s it\'', 'OQLParserSyntaxErrorException'),
+ array('SELECT toto WHERE toto.a NOT LIKE "blah \\ truc"', 'Exception'),
+ array('SELECT toto WHERE toto.a NOT LIKE \'blah \\ truc\'', 'Exception'),
+ array('SELECT A JOIN B ON A.myB = B.id JOIN C ON C.parent_id = B.id WHERE A.col1 BELOW 2 AND B.id = 3', 'OQLParserSyntaxErrorException'),
+ );
+ }
+
+ /**
+ * Needs actual datamodel
+ * @depends testOQLSetup
+ *
+ * @dataProvider QueryNormalizationProvider
+ *
+ * @param $sQuery
+ * @param $sExpectedExceptionClass
+ *
+ */
+ public function testQueryNormalization($sQuery, $sExpectedExceptionClass)
+ {
+ $this->debug($sQuery);
+ $sExceptionClass = '';
+ try
+ {
+ $oSearch = DBObjectSearch::FromOQL($sQuery);
+ static::assertInstanceOf('DBObjectSearch', $oSearch);
+ }
+ catch (Exception $e)
+ {
+ $sExceptionClass = get_class($e);
+ }
+
+ static::assertEquals($sExpectedExceptionClass, $sExceptionClass);
+ }
+
+
+ public function QueryNormalizationProvider()
+ {
+ return array(
+ array('SELECT Contact', ''),
+ array('SELECT Contact WHERE nom_de_famille = "foo"', 'OqlNormalizeException'),
+ array('SELECT Contact AS c WHERE name = "foo"', ''),
+ array('SELECT Contact AS c WHERE nom_de_famille = "foo"', 'OqlNormalizeException'),
+ array('SELECT Contact AS c WHERE c.name = "foo"', ''),
+ array('SELECT Contact AS c WHERE Contact.name = "foo"', 'OqlNormalizeException'),
+ array('SELECT Contact AS c WHERE x.name = "foo"', 'OqlNormalizeException'),
+
+ array('SELECT Organization AS child JOIN Organization AS root ON child.parent_id BELOW root.id', ''),
+ array('SELECT Organization AS root JOIN Organization AS child ON child.parent_id BELOW root.id', ''),
+
+ array('SELECT RelationProfessionnelle', 'UnknownClassOqlException'),
+ array('SELECT RelationProfessionnelle AS c WHERE name = "foo"', 'UnknownClassOqlException'),
+
+ // The first query is the base query altered only in one place in the subsequent queries
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE p.name LIKE "foo"', ''),
+ array('SELECT Person AS p JOIN lnkXXXXXXXXXXXX AS lnk ON lnk.person_id = p.id WHERE p.name LIKE "foo"', 'UnknownClassOqlException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON p.person_id = p.id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON person_id = p.id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.role = p.id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.team_id = p.id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id BELOW p.id WHERE p.name LIKE "bar"', ''),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.org_id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON p.id = lnk.person_id WHERE p.name LIKE "foo"', 'OqlNormalizeException'), // inverted the JOIN spec
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE name LIKE "foo"', ''),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE x.name LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE p.eman LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE eman LIKE "foo"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON lnk.person_id = p.id WHERE id = 1', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN lnkPersonToTeam AS lnk ON p.id = lnk.person_id WHERE p.name LIKE "foo"', 'OqlNormalizeException'),
+
+ array('SELECT Person AS p JOIN Organization AS o ON p.org_id = o.id WHERE p.name LIKE "foo" AND o.name LIKE "land"', ''),
+ array('SELECT Person AS p JOIN Organization AS o ON p.location_id = o.id WHERE p.name LIKE "foo" AND o.name LIKE "land"', 'OqlNormalizeException'),
+ array('SELECT Person AS p JOIN Organization AS o ON p.name = o.id WHERE p.name LIKE "foo" AND o.name LIKE "land"', 'OqlNormalizeException'),
+
+ array('SELECT Person AS p JOIN Organization AS o ON p.org_id = o.id JOIN Person AS p ON p.org_id = o.id', 'OqlNormalizeException'),
+ array('SELECT Person JOIN Organization AS o ON Person.org_id = o.id JOIN Person ON Person.org_id = o.id', 'OqlNormalizeException'),
+
+ array('SELECT Person AS p JOIN Location AS l ON p.location_id = l.id', ''),
+ array('SELECT Person AS p JOIN Location AS l ON p.location_id BELOW l.id', 'OqlNormalizeException'),
+
+ array('SELECT Person FROM Person JOIN Location ON Person.location_id = Location.id', ''),
+ array('SELECT p FROM Person AS p JOIN Location AS l ON p.location_id = l.id', ''),
+ array('SELECT l FROM Person AS p JOIN Location AS l ON p.location_id = l.id', ''),
+ array('SELECT l, p FROM Person AS p JOIN Location AS l ON p.location_id = l.id', ''),
+ array('SELECT p, l FROM Person AS p JOIN Location AS l ON p.location_id = l.id', ''),
+ array('SELECT foo FROM Person AS p JOIN Location AS l ON p.location_id = l.id', 'OqlNormalizeException'),
+ array('SELECT p, foo FROM Person AS p JOIN Location AS l ON p.location_id = l.id', 'OqlNormalizeException'),
+
+ // Joins based on AttributeObjectKey
+ //
+ array('SELECT Attachment AS a JOIN UserRequest AS r ON a.item_id = r.id', ''),
+ array('SELECT UserRequest AS r JOIN Attachment AS a ON a.item_id = r.id', ''),
+ );
+ }
+
+
+ /**
+ * @depends testOQLSetup
+ * @dataProvider OQLIntersectProvider
+ *
+ * Needs specific datamodel from unit-test-specific module
+ * for lnkGRTypeToServiceSubcategory and GRType classes
+ *
+ * @throws \CoreException
+ * @throws \OQLException
+ */
+ public function testOQLIntersect($sOQL1, $sOQL2, $sOQLIntersect)
+ {
+ // Check that legacy mode is not set
+ $this->assertFalse(utils::GetConfig()->Get('use_legacy_dbsearch'));
+ $this->assertFalse(utils::GetConfig()->Get('apc_cache.enabled'));
+ $this->assertFalse(utils::GetConfig()->Get('query_cache_enabled'));
+ $this->assertFalse(utils::GetConfig()->Get('expression_cache_enabled'));
+
+ $oSearch1 = DBSearch::FromOQL($sOQL1);
+ $oSearch2 = DBSearch::FromOQL($sOQL2);
+ $oSearchI = $oSearch1->Intersect($oSearch2);
+
+ $sOQLResult = $oSearchI->ToOQL();
+ //$this->debug($sOQLResult);
+
+ self::assertEquals($sOQLIntersect, $sOQLResult);
+ }
+
+ public function OQLIntersectProvider()
+ {
+ return array(
+ // Wrong result:
+ /*
+ SELECT `SSC`
+ FROM ServiceSubcategory AS `SSC`
+ JOIN Service AS `S` ON `SSC`.service_id = `S`.id
+ JOIN lnkCustomerContractToService AS `l1` ON `l1`.service_id = `S`.id
+ JOIN CustomerContract AS `cc` ON `l1`.customercontract_id = `cc`.id
+ JOIN lnkGRTypeToServiceSubcategory AS `l1` ON `l1`.servicesubcategory_id = `SSC`.id
+ JOIN GRType AS `GRT` ON `l1`.grtype_id = `GRT`.id
+ WHERE ((`GRT`.`id` = :grtype_id) AND ((`cc`.`org_id` = :current_contact->org_id) AND (`SSC`.`status` != 'obsolete')))
+ */
+// Needs specific data model from unit-test-specific module for lnkGRTypeToServiceSubcategory and GRType classes
+// 'ServiceSubcategory' => array(
+// "SELECT ServiceSubcategory AS SSC JOIN lnkGRTypeToServiceSubcategory AS l1 ON l1.servicesubcategory_id = SSC.id JOIN GRType AS GRT ON l1.grtype_id = GRT.id JOIN Service AS S ON SSC.service_id = S.id WHERE GRT.id = :grtype_id",
+// "SELECT ServiceSubcategory AS ssc JOIN Service AS s ON ssc.service_id=s.id JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :current_contact->org_id AND ssc.status != 'obsolete'",
+// "SELECT `SSC` FROM ServiceSubcategory AS `SSC` JOIN Service AS `S` ON `SSC`.service_id = `S`.id JOIN lnkCustomerContractToService AS `l11` ON `l11`.service_id = `S`.id JOIN CustomerContract AS `cc` ON `l11`.customercontract_id = `cc`.id JOIN lnkGRTypeToServiceSubcategory AS `l1` ON `l1`.servicesubcategory_id = `SSC`.id JOIN GRType AS `GRT` ON `l1`.grtype_id = `GRT`.id WHERE ((`GRT`.`id` = :grtype_id) AND ((`cc`.`org_id` = :current_contact->org_id) AND (`SSC`.`status` != 'obsolete')))"
+// ),
+ 'Person' => array(
+ "SELECT P FROM Person AS P JOIN lnkPersonToTeam AS l1 ON l1.person_id = P.id JOIN Team AS T ON l1.team_id = T.id WHERE T.id = 3",
+ "SELECT p FROM Person AS p JOIN Person AS mgr ON p.manager_id = mgr.id JOIN lnkContactToTicket AS l1 ON l1.contact_id = mgr.id JOIN Ticket AS T ON l1.ticket_id = T.id WHERE T.id = 4 AND p.id = 3",
+ "SELECT `P` FROM Person AS `P` JOIN Person AS `mgr` ON `P`.manager_id = `mgr`.id JOIN lnkContactToTicket AS `l11` ON `l11`.contact_id = `mgr`.id JOIN Ticket AS `T1` ON `l11`.ticket_id = `T1`.id JOIN lnkPersonToTeam AS `l1` ON `l1`.person_id = `P`.id JOIN Team AS `T` ON `l1`.team_id = `T`.id WHERE ((`T`.`id` = 3) AND ((`T1`.`id` = 4) AND (`P`.`id` = 3)))"
+ ),
+ 'Person2' => array(
+ "SELECT P FROM Person AS P JOIN lnkPersonToTeam AS l1 ON l1.person_id = P.id JOIN Team AS T ON l1.team_id = T.id JOIN Person AS MGR ON P.manager_id = MGR.id WHERE T.id = 3",
+ "SELECT p FROM Person AS p JOIN Person AS mgr ON p.manager_id = mgr.id JOIN lnkContactToTicket AS l1 ON l1.contact_id = mgr.id JOIN Ticket AS T ON l1.ticket_id = T.id WHERE T.id = 4 AND p.id = 3",
+ "SELECT `P` FROM Person AS `P` JOIN Person AS `MGR` ON `P`.manager_id = `MGR`.id JOIN lnkContactToTicket AS `l11` ON `l11`.contact_id = `MGR`.id JOIN Ticket AS `T1` ON `l11`.ticket_id = `T1`.id JOIN lnkPersonToTeam AS `l1` ON `l1`.person_id = `P`.id JOIN Team AS `T` ON `l1`.team_id = `T`.id WHERE ((`T`.`id` = 3) AND ((`T1`.`id` = 4) AND (`P`.`id` = 3)))"
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider MakeSelectQueryProvider
+ * @param $sOQL
+ * @param $sExpectedExceptionClass
+ */
+ public function testMakeSelectQuery($sOQL, $sExpectedExceptionClass = '')
+ {
+ $sExceptionClass = '';
+ try
+ {
+ $oSearch = DBSearch::FromOQL($sOQL);
+ CMDBSource::TestQuery($oSearch->MakeSelectQuery());
+ }
+ catch (Exception $e)
+ {
+ $this->debug($e->getMessage());
+ $sExceptionClass = get_class($e);
+ }
+
+ static::assertEquals($sExpectedExceptionClass, $sExceptionClass);
+ }
+
+ public function MakeSelectQueryProvider()
+ {
+ return array(
+ array("SELECT `UserRequest` FROM UserRequest AS `UserRequest` JOIN Person AS `P` ON `UserRequest`.agent_id = `P`.id JOIN Organization AS `Organization` ON `P`.org_id = `Organization`.id WHERE (`UserRequest`.`org_id` IN (SELECT `Organization` FROM Organization AS `Organization` WHERE (`Organization`.`id` = `Toto`.`org_id`)))", 'OqlNormalizeException'),
+ array("SELECT `UserRequest` FROM UserRequest AS `UserRequest` JOIN Person AS `P` ON `UserRequest`.agent_id = `P`.id JOIN Organization AS `Organization` ON `P`.org_id = `Organization`.id WHERE (`UserRequest`.`org_id` IN (SELECT `Organization` FROM Organization AS `Organization` WHERE (`Organization`.`id` = `UserRequest`.`org_id`)))"),
+ array("SELECT `U` FROM User AS `U` JOIN Person AS `P` ON `U`.contactid = `P`.id WHERE ((`U`.`status` = 'enabled') AND (`U`.`id` NOT IN (SELECT `U` FROM User AS `U` JOIN Person AS `P` ON `U`.contactid = `P`.id JOIN URP_UserOrg AS `L` ON `L`.userid = `U`.id WHERE ((`U`.`status` = 'enabled') AND (`L`.`allowed_org_id` = `P`.`org_id`)) UNION SELECT `U` FROM User AS `U` WHERE ((`U`.`status` = 'enabled') AND (`U`.`id` NOT IN (SELECT `U` FROM User AS `U` JOIN URP_UserOrg AS `L` ON `L`.userid = `U`.id WHERE (`U`.`status` = 'enabled')))))))"),
+ array("SELECT `Ur` FROM UserRequest AS `Ur` WHERE (`Ur`.`id` NOT IN (SELECT `Ur` FROM UserRequest AS `Ur` JOIN lnkFunctionalCIToTicket AS `lnk` ON `lnk`.ticket_id = `Ur`.id WHERE 1))"),
+ array("SELECT `T` FROM Ticket AS `T` WHERE ((`T`.`finalclass` IN ('userrequest', 'change')) AND (`T`.`id` NOT IN (SELECT `Ur` FROM UserRequest AS `Ur` JOIN lnkFunctionalCIToTicket AS `lnk` ON `lnk`.ticket_id = `Ur`.id WHERE 1 UNION SELECT `C` FROM Change AS `C` JOIN lnkFunctionalCIToTicket AS `lnk` ON `lnk`.ticket_id = `C`.id WHERE 1)))"),
+ array("SELECT `PhysicalDevice` FROM PhysicalDevice AS `PhysicalDevice` WHERE ((`PhysicalDevice`.`status` = 'production') AND (`PhysicalDevice`.`id` NOT IN (SELECT `p` FROM PhysicalDevice AS `p` JOIN lnkFunctionalCIToProviderContract AS `l` ON `l`.functionalci_id = `p`.id WHERE 1)))"),
+ array("SELECT `U` FROM User AS `U` JOIN Person AS `P` ON `U`.contactid = `P`.id WHERE ((`U`.`status` = 'enabled') AND (`U`.`id` NOT IN (SELECT `U` FROM User AS `U` JOIN Person AS `P` ON `U`.contactid = `P`.id JOIN URP_UserOrg AS `L` ON `L`.userid = `U`.id WHERE ((`U1`.`status` = 'enabled') AND (`L`.`allowed_org_id` = `P`.`org_id`)) UNION SELECT `U` FROM User AS `U` WHERE ((`U`.`status` = 'enabled') AND (`U`.`id` NOT IN (SELECT `U` FROM User AS `U` JOIN URP_UserOrg AS `L` ON `L`.userid = `U`.id WHERE (`U`.`status` = 'enabled')))))))", "OqlNormalizeException"),
+ array("SELECT Team WHERE id NOT IN (SELECT Team AS t JOIN lnkPersonToTeam AS l ON l.team_id=t.id WHERE 1)"),
+ array("SELECT UserRequest WHERE id NOT IN (SELECT UserRequest AS u JOIN lnkFunctionalCIToTicket AS l ON l.ticket_id=u.id JOIN PhysicalDevice AS f ON l.functionalci_id=f.id WHERE f.status='production')"),
+ array("SELECT UserRequest WHERE id NOT IN (SELECT UserRequest AS u JOIN lnkFunctionalCIToTicket AS l ON l.ticket_id=u.id JOIN PhysicalDevice AS f ON l.functionalci_id=f.id WHERE f.status='production' UNION SELECT UserRequest AS u JOIN lnkFunctionalCIToTicket AS l ON l.ticket_id=u.id JOIN ApplicationSolution AS f ON l.functionalci_id=f.id WHERE f.status='active')"),
+ array("SELECT Person WHERE status='active' AND id NOT IN (SELECT Person AS p JOIN User AS u ON u.contactid=p.id WHERE u.status='enabled')"),
+ );
+ }
+
+
+ /**
+ * @dataProvider GetOQLClassTreeProvider
+ * @param $sOQL
+ * @param $sExpectedOQL
+ */
+ public function testGetOQLClassTree($sOQL, $sExpectedOQL)
+ {
+ $oFilter = DBSearch::FromOQL($sOQL);
+ $aCountAttToLoad = array();
+ $sMainClass = null;
+ foreach ($oFilter->GetSelectedClasses() as $sClassAlias => $sClass)
+ {
+ $aCountAttToLoad[$sClassAlias] = array();
+ if (empty($sMainClass))
+ {
+ $sMainClass = $sClass;
+ }
+ }
+ $aModifierProperties = MetaModel::MakeModifierProperties($oFilter);
+ $oSQLObjectQueryBuilder = new SQLObjectQueryBuilder($oFilter);
+ $oBuild = new QueryBuilderContext($oFilter, $aModifierProperties, null, null, null, $aCountAttToLoad);
+ $sResultOQL = $oSQLObjectQueryBuilder->DebugOQLClassTree($oBuild);
+
+ static::assertEquals($sExpectedOQL, $sResultOQL);
+ }
+
+ public function GetOQLClassTreeProvider()
+ {
+ return [
+ 'Bug 3660 1' => [
+ "SELECT UserRequest AS U JOIN lnkContactToTicket AS l ON l.ticket_id=U.id JOIN Team AS T ON l.contact_id=T.id",
+ "SELECT `U` FROM `UserRequest` AS `U`
+ INNER JOIN `lnkContactToTicket` AS `l`
+ ON `U`.`id` = `l`.`ticket_id`
+ INNER JOIN `Team` AS `T`
+ ON `l`.`contact_id` = `T`.`id`",
+ ],
+ 'Bug 3660 2' => [
+ "SELECT UserRequest AS U JOIN lnkContactToTicket AS l ON l.ticket_id=U.id JOIN Contact AS C ON l.contact_id=C.id",
+ "SELECT `U` FROM `UserRequest` AS `U`
+ INNER JOIN `lnkContactToTicket` AS `l`
+ ON `U`.`id` = `l`.`ticket_id`",
+ ],
+ ];
+ }
+
+ /**
+ * @dataProvider MakeSelectQueryForCountProvider
+ *
+ * @param $sOQL
+ * @param $sExpectedSQL
+ *
+ * @throws \CoreException
+ * @throws \MissingQueryArgument
+ * @throws \OQLException
+ */
+ public function testMakeSelectQueryForCount($sOQL, $sExpectedSQL)
+ {
+ $oFilter = DBSearch::FromOQL($sOQL);
+ // Avoid adding all the fields for counts or "group by" requests
+ $aCountAttToLoad = array();
+ $sMainClass = null;
+ foreach ($oFilter->GetSelectedClasses() as $sClassAlias => $sClass) {
+ $aCountAttToLoad[$sClassAlias] = array();
+ if (empty($sMainClass)) {
+ $sMainClass = $sClass;
+ }
+ }
+ $sSQL = $oFilter->MakeSelectQuery([], [], $aCountAttToLoad, null, 0, 0, true);
+ static::assertEquals($sExpectedSQL, $sSQL);
+ }
+
+ public function MakeSelectQueryForCountProvider()
+ {
+ return [
+ 'Bug 3618' => [
+ "SELECT UserRequest WHERE private_log LIKE '%Auteur : %' UNION SELECT UserRequest",
+ "SELECT COUNT(*) AS COUNT FROM (SELECT
+ 1
+ FROM (
+SELECT
+ DISTINCT `UserRequest_Ticket`.`id` AS `UserRequestid`
+ FROM
+ `ticket` AS `UserRequest_Ticket`
+ WHERE ((`UserRequest_Ticket`.`private_log` LIKE '%Auteur : %') AND COALESCE((`UserRequest_Ticket`.`finalclass` IN ('UserRequest')), 1))
+
+ UNION
+ SELECT
+ DISTINCT `UserRequest`.`id` AS `UserRequestid`
+ FROM
+ `ticket_request` AS `UserRequest`
+ WHERE 1
+
+) as __selects__
+) AS _union_alderaan_",
+ ],
+ ];
+ }
+}
diff --git a/test/core/TagSetFieldDataTest.php b/tests/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php
similarity index 100%
rename from test/core/TagSetFieldDataTest.php
rename to tests/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php
diff --git a/test/core/TriggerTest.php b/tests/php-unit-tests/unitary-tests/core/TriggerTest.php
similarity index 100%
rename from test/core/TriggerTest.php
rename to tests/php-unit-tests/unitary-tests/core/TriggerTest.php
diff --git a/test/core/UniquenessConstraintTest.php b/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php
similarity index 96%
rename from test/core/UniquenessConstraintTest.php
rename to tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php
index e497ea4df..8b8c384db 100644
--- a/test/core/UniquenessConstraintTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php
@@ -19,7 +19,7 @@ class UniquenessConstraintTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'/core/metamodel.class.php');
+ $this->RequireOnceItopFile('core/metamodel.class.php');
}
/**
diff --git a/test/core/UserRightsTest.php b/tests/php-unit-tests/unitary-tests/core/UserRightsTest.php
similarity index 100%
rename from test/core/UserRightsTest.php
rename to tests/php-unit-tests/unitary-tests/core/UserRightsTest.php
diff --git a/test/core/WeeklyScheduledProcessMockConfig.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php
similarity index 100%
rename from test/core/WeeklyScheduledProcessMockConfig.php
rename to tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php
diff --git a/test/core/WeeklyScheduledProcessTest.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php
similarity index 95%
rename from test/core/WeeklyScheduledProcessTest.php
rename to tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php
index 09c6502e4..18f5d1854 100644
--- a/test/core/WeeklyScheduledProcessTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php
@@ -10,8 +10,8 @@ class WeeklyScheduledProcessTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/backgroundprocess.inc.php');
- require_once(APPROOT.'test/core/WeeklyScheduledProcessMockConfig.php');
+ $this->RequireOnceItopFile('core/backgroundprocess.inc.php');
+ $this->RequireOnceUnitTestFile('./WeeklyScheduledProcessMockConfig.php');
}
diff --git a/test/core/XMLDataLoaderTest.php b/tests/php-unit-tests/unitary-tests/core/XMLDataLoaderTest.php
similarity index 100%
rename from test/core/XMLDataLoaderTest.php
rename to tests/php-unit-tests/unitary-tests/core/XMLDataLoaderTest.php
diff --git a/test/core/apcEmulationTest.php b/tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php
similarity index 99%
rename from test/core/apcEmulationTest.php
rename to tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php
index 912554fee..136bc825b 100644
--- a/test/core/apcEmulationTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php
@@ -42,7 +42,7 @@ class apcEmulationTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'core/apc-emulation.php');
+ $this->RequireOnceItopFile('core/apc-emulation.php');
require_once 'mockApcEmulation.incphp';
apc_clear_cache();
}
diff --git a/test/core/dictApcuTest.php b/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php
similarity index 99%
rename from test/core/dictApcuTest.php
rename to tests/php-unit-tests/unitary-tests/core/dictApcuTest.php
index 332bab81e..773d23f08 100644
--- a/test/core/dictApcuTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php
@@ -45,7 +45,7 @@ class dictApcuTest extends ItopTestCase
{
parent::setUp();
- require_once (APPROOT.'core' . DIRECTORY_SEPARATOR . 'apc-service.class.inc.php');
+ $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php');
$this->sEnvName = time();
$_SESSION['itop_env'] = $this->sEnvName;
diff --git a/test/core/dictTest.php b/tests/php-unit-tests/unitary-tests/core/dictTest.php
similarity index 97%
rename from test/core/dictTest.php
rename to tests/php-unit-tests/unitary-tests/core/dictTest.php
index 96ec0a923..8eba1f9e0 100644
--- a/test/core/dictTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/dictTest.php
@@ -43,7 +43,7 @@ class dictTest extends ItopTestCase
{
parent::setUp();
- require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php');
+ $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php');
$this->sEnvName = time();
$sDictionaryFolder = APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries";
diff --git a/test/core/iTopConfigParserTest.php b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php
similarity index 97%
rename from test/core/iTopConfigParserTest.php
rename to tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php
index 5c7810ac8..19378eb4b 100644
--- a/test/core/iTopConfigParserTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php
@@ -17,8 +17,8 @@ class iTopConfigParserTest extends ItopTestCase
public function setUp(): void
{
parent::setUp();
- require_once APPROOT.'/core/iTopConfigParser.php';
- require_once APPROOT.'/setup/runtimeenv.class.inc.php';
+ $this->RequireOnceItopFile('/core/iTopConfigParser.php');
+ $this->RequireOnceItopFile('/setup/runtimeenv.class.inc.php');
clearstatcache();
$this->sConfigPath = utils::GetConfigFilePath();
diff --git a/test/core/mockApcEmulation.incphp b/tests/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp
similarity index 100%
rename from test/core/mockApcEmulation.incphp
rename to tests/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp
diff --git a/test/core/mockDict.incphp b/tests/php-unit-tests/unitary-tests/core/mockDict.incphp
similarity index 100%
rename from test/core/mockDict.incphp
rename to tests/php-unit-tests/unitary-tests/core/mockDict.incphp
diff --git a/test/core/ormCaseLogTest.php b/tests/php-unit-tests/unitary-tests/core/ormCaseLogTest.php
similarity index 100%
rename from test/core/ormCaseLogTest.php
rename to tests/php-unit-tests/unitary-tests/core/ormCaseLogTest.php
diff --git a/test/core/ormLinkSetTest.php b/tests/php-unit-tests/unitary-tests/core/ormLinkSetTest.php
similarity index 100%
rename from test/core/ormLinkSetTest.php
rename to tests/php-unit-tests/unitary-tests/core/ormLinkSetTest.php
diff --git a/test/core/ormPasswordTest.php b/tests/php-unit-tests/unitary-tests/core/ormPasswordTest.php
similarity index 100%
rename from test/core/ormPasswordTest.php
rename to tests/php-unit-tests/unitary-tests/core/ormPasswordTest.php
diff --git a/test/core/ormStyleTest.php b/tests/php-unit-tests/unitary-tests/core/ormStyleTest.php
similarity index 100%
rename from test/core/ormStyleTest.php
rename to tests/php-unit-tests/unitary-tests/core/ormStyleTest.php
diff --git a/test/core/ormTagSetTest.php b/tests/php-unit-tests/unitary-tests/core/ormTagSetTest.php
similarity index 100%
rename from test/core/ormTagSetTest.php
rename to tests/php-unit-tests/unitary-tests/core/ormTagSetTest.php
diff --git a/test/core/sanitizer/AbstractDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php
similarity index 92%
rename from test/core/sanitizer/AbstractDOMSanitizerTest.php
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php
index a9fb5d945..f09378dc7 100644
--- a/test/core/sanitizer/AbstractDOMSanitizerTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php
@@ -12,8 +12,8 @@ abstract class AbstractDOMSanitizerTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'application/utils.inc.php');
- require_once(APPROOT.'core/htmlsanitizer.class.inc.php');
+ $this->RequireOnceItopFile('application/utils.inc.php');
+ $this->RequireOnceItopFile('core/htmlsanitizer.class.inc.php');
}
protected function ReadTestFile($sFileToTest, $sFolderName)
diff --git a/test/core/sanitizer/HTMLDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php
similarity index 99%
rename from test/core/sanitizer/HTMLDOMSanitizerTest.php
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php
index 1f3233158..0e3771170 100644
--- a/test/core/sanitizer/HTMLDOMSanitizerTest.php
+++ b/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php
@@ -222,7 +222,7 @@ class HTMLDOMSanitizerTest extends AbstractDOMSanitizerTest
*/
public function testDoSanitizeCallInlineImageProcessImageTag($sHtml, $iExpectedCount)
{
- require_once APPROOT.'test/core/sanitizer/InlineImageMock.php';
+ $this->RequireOnceUnitTestFile('./InlineImageMock.php');
InlineImageMock::ResetCallCounter();
$oSanitizer = new HTMLDOMSanitizer(InlineImageMock::class);
diff --git a/test/core/sanitizer/InlineImageMock.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php
similarity index 100%
rename from test/core/sanitizer/InlineImageMock.php
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php
diff --git a/test/core/sanitizer/README.txt b/tests/php-unit-tests/unitary-tests/core/sanitizer/README.txt
similarity index 100%
rename from test/core/sanitizer/README.txt
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/README.txt
diff --git a/test/core/sanitizer/SvgDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php
similarity index 100%
rename from test/core/sanitizer/SvgDOMSanitizerTest.php
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php
diff --git a/test/core/sanitizer/input/scripts.html b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html
similarity index 100%
rename from test/core/sanitizer/input/scripts.html
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html
diff --git a/test/core/sanitizer/input/scripts.svg b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg
similarity index 100%
rename from test/core/sanitizer/input/scripts.svg
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg
diff --git a/test/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt
similarity index 100%
rename from test/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt
diff --git a/test/core/sanitizer/input/whitelist_test.html b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html
similarity index 100%
rename from test/core/sanitizer/input/whitelist_test.html
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html
diff --git a/test/core/sanitizer/output/scripts.html b/tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html
similarity index 100%
rename from test/core/sanitizer/output/scripts.html
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html
diff --git a/test/core/sanitizer/output/scripts.svg b/tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg
similarity index 100%
rename from test/core/sanitizer/output/scripts.svg
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg
diff --git a/test/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt b/tests/php-unit-tests/unitary-tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt
similarity index 100%
rename from test/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt
rename to tests/php-unit-tests/unitary-tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt
diff --git a/test/coreExtensions/UserLocalTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php
similarity index 98%
rename from test/coreExtensions/UserLocalTest.php
rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php
index 65864b137..cb0d392ed 100644
--- a/test/coreExtensions/UserLocalTest.php
+++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php
@@ -25,8 +25,8 @@ class UserLocalTest extends ItopDataTestCase
{
parent::setUp();
- require_once(APPROOT.'test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php');
- require_once(APPROOT.'env-production/authent-local/model.authent-local.php');
+ $this->RequireOnceUnitTestFile('./UserLocalTest/UserLocalPasswordPolicyMock.php');
+ $this->RequireOnceItopFile('env-production/authent-local/model.authent-local.php');
}
/**
diff --git a/test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php
similarity index 100%
rename from test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php
rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php
diff --git a/test/itop-config/Validator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php
similarity index 90%
rename from test/itop-config/Validator/iTopConfigAstValidatorTest.php
rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php
index c29d285d6..c94292bee 100644
--- a/test/itop-config/Validator/iTopConfigAstValidatorTest.php
+++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.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';
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/ConfigNodesVisitor.php');
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/iTopConfigAstValidator.php');
}
diff --git a/test/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php
similarity index 86%
rename from test/itop-config/Validator/iTopConfigSyntaxValidatorTest.php
rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php
index 63ade2736..10990db60 100644
--- a/test/itop-config/Validator/iTopConfigSyntaxValidatorTest.php
+++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.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';
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/ConfigNodesVisitor.php');
+ $this->RequireOnceItopFile('env-production/itop-config/src/Validator/iTopConfigSyntaxValidator.php');
}
diff --git a/test/itop-tickets/itopTicketTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php
similarity index 100%
rename from test/itop-tickets/itopTicketTest.php
rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php
diff --git a/test/setup/DBBackupTest.php b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php
similarity index 97%
rename from test/setup/DBBackupTest.php
rename to tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php
index 3ad7a2115..390082d16 100644
--- a/test/setup/DBBackupTest.php
+++ b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php
@@ -22,7 +22,7 @@ class DBBackupTest extends ItopTestCase
protected function setUp(): void
{
parent::setUp();
- require_once(APPROOT.'setup/backup.class.inc.php');
+ $this->RequireOnceItopFile('setup/backup.class.inc.php');
// We need a connection to the DB, so let's open it !
// We are using the default config file... as the server might not be configured for all the combination we are testing
diff --git a/test/setup/MFCompilerTest.php b/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php
similarity index 98%
rename from test/setup/MFCompilerTest.php
rename to tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php
index bac63dd94..4857b9914 100644
--- a/test/setup/MFCompilerTest.php
+++ b/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php
@@ -22,9 +22,9 @@ class MFCompilerTest extends ItopTestCase {
public function setUp(): void {
parent::setUp();
- require_once(APPROOT.'setup/compiler.class.inc.php');
- require_once(APPROOT.'setup/modelfactory.class.inc.php');
- require_once(__DIR__.'/SubMFCompiler.php');
+ $this->RequireOnceItopFile('setup/compiler.class.inc.php');
+ $this->RequireOnceItopFile('setup/modelfactory.class.inc.php');
+ $this->RequireOnceUnitTestFile('./SubMFCompiler.php');
$this->sTmpDir = $this->CreateTmpdir();
$this->oMFCompiler = new SubMFCompiler($this->createMock(\ModelFactory::class), '');
diff --git a/test/setup/ModelFactoryTest.php b/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php
similarity index 99%
rename from test/setup/ModelFactoryTest.php
rename to tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php
index 46c7aef2c..94e56cf67 100644
--- a/test/setup/ModelFactoryTest.php
+++ b/tests/php-unit-tests/unitary-tests/setup/ModelFactoryTest.php
@@ -36,7 +36,7 @@ class ModelFactoryTest extends ItopTestCase
{
parent::setUp();
- require_once(APPROOT.'setup/modelfactory.class.inc.php');
+ $this->RequireOnceItopFile('setup/modelfactory.class.inc.php');
}
/**
diff --git a/test/setup/SetupUtilsTest.php b/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php
similarity index 96%
rename from test/setup/SetupUtilsTest.php
rename to tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php
index cb95fc68e..53b89f8f4 100644
--- a/test/setup/SetupUtilsTest.php
+++ b/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php
@@ -26,8 +26,8 @@ class SetupUtilsTest extends ItopTestCase
{
parent::setUp();
- require_once APPROOT.'setup/setuputils.class.inc.php';
- require_once APPROOT.'setup/setuppage.class.inc.php';
+ $this->RequireOnceItopFile('setup/setuputils.class.inc.php');
+ $this->RequireOnceItopFile('setup/setuppage.class.inc.php');
}
/**
diff --git a/test/setup/SubMFCompiler.php b/tests/php-unit-tests/unitary-tests/setup/SubMFCompiler.php
similarity index 100%
rename from test/setup/SubMFCompiler.php
rename to tests/php-unit-tests/unitary-tests/setup/SubMFCompiler.php
diff --git a/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml
new file mode 100644
index 000000000..280019cad
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml
new file mode 100644
index 000000000..ec041ae93
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.6_to_1.7_2.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_1.6_2.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/1.7_to_3.0.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/3.0_to_1.7.input.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/Bug_4569.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/Bug_4569.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/Bug_4569.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/Bug_4569.expected.xml
diff --git a/test/setup/iTopDesignFormat/Convert-samples/Bug_4569.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/Bug_4569.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/Convert-samples/Bug_4569.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/Convert-samples/Bug_4569.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_deleted.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_deleted_to_not-in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_deleted.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_in-definition_to_not-in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_deleted.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.expected.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.expected.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.expected.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.expected.xml
diff --git a/test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.input.xml b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.input.xml
similarity index 100%
rename from test/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.input.xml
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/MoveNode-samples/from_not-in-definition_to_not-in-definition.input.xml
diff --git a/test/setup/iTopDesignFormat/iTopDesignFormatTest.php b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php
similarity index 97%
rename from test/setup/iTopDesignFormat/iTopDesignFormatTest.php
rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php
index acb878377..73148a13c 100644
--- a/test/setup/iTopDesignFormat/iTopDesignFormatTest.php
+++ b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php
@@ -20,8 +20,8 @@ class iTopDesignFormatTest extends ItopTestCase
{
parent::setUp();
- require_once APPROOT.'setup/modelfactory.class.inc.php';
- require_once APPROOT.'setup/itopdesignformat.class.inc.php';
+ $this->RequireOnceItopFile('setup/modelfactory.class.inc.php');
+ $this->RequireOnceItopFile('setup/itopdesignformat.class.inc.php');
}
/**
diff --git a/test/setup/ressources/datamodels/datamodel-branding.xml b/tests/php-unit-tests/unitary-tests/setup/ressources/datamodels/datamodel-branding.xml
similarity index 100%
rename from test/setup/ressources/datamodels/datamodel-branding.xml
rename to tests/php-unit-tests/unitary-tests/setup/ressources/datamodels/datamodel-branding.xml
diff --git a/test/application/composer/iTopComposerTest.php b/tests/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php
similarity index 94%
rename from test/application/composer/iTopComposerTest.php
rename to tests/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php
index d04db2827..64554f4d8 100644
--- a/test/application/composer/iTopComposerTest.php
+++ b/tests/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php
@@ -22,8 +22,6 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
* along with iTop. If not, see
*
*/
-
-
class iTopComposerTest extends ItopTestCase
{
@@ -84,8 +82,7 @@ class iTopComposerTest extends ItopTestCase
$this->assertTrue(is_array($aDirs));
$aDeniedDirWrongFormat = [];
- foreach ($aDirs as $sDir)
- {
+ foreach ($aDirs as $sDir) {
if (false === iTopComposer::IsTestDir($sDir)) {
$aDeniedDirWrongFormat[] = $sDir;
}
@@ -138,8 +135,8 @@ class iTopComposerTest extends ItopTestCase
$this->assertEmpty(
$aMissing,
'Test dirs exists in /lib !'."\n"
- .' They must be declared either in the allowed or denied list in '.iTopComposer::class." (see N°2651).\n"
- .' List of dirs:'."\n".var_export($aMissing, true)
+ .' They must be declared either in the allowed or denied list in '.iTopComposer::class." (see N°2651).\n"
+ .' List of dirs:'."\n".var_export($aMissing, true)
);
}
}
diff --git a/test/sources/application/Helper/WebResourcesHelperTest.php b/tests/php-unit-tests/unitary-tests/sources/application/Helper/WebResourcesHelperTest.php
similarity index 100%
rename from test/sources/application/Helper/WebResourcesHelperTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/Helper/WebResourcesHelperTest.php
diff --git a/test/application/RuntimeDashboardTest.php b/tests/php-unit-tests/unitary-tests/sources/application/RuntimeDashboardTest.php
similarity index 100%
rename from test/application/RuntimeDashboardTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/RuntimeDashboardTest.php
diff --git a/test/application/TestAutoload.php b/tests/php-unit-tests/unitary-tests/sources/application/TestAutoload.php
similarity index 100%
rename from test/application/TestAutoload.php
rename to tests/php-unit-tests/unitary-tests/sources/application/TestAutoload.php
diff --git a/test/twig/TwigTest.php b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php
similarity index 76%
rename from test/twig/TwigTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php
index f14420c81..c01ad8606 100644
--- a/test/twig/TwigTest.php
+++ b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php
@@ -15,7 +15,7 @@ class TwigTest extends ItopDataTestCase
protected function setUp(): void
{
parent::setUp();
- require_once __DIR__.'/../../core/config.class.inc.php';
+ $this->RequireOnceItopFile('core/config.class.inc.php');
}
/**
@@ -43,18 +43,14 @@ class TwigTest extends ItopDataTestCase
{
$oTwig->addFunction($oFunction);
}
-
- $sHtml = $oTwig->render($sId, ['AttackerURL' => 'file://'.__DIR__.'/attacker']);
-
- $this->assertEquals($sExpected, $sHtml);
}
- public static function TemplateProvider()
+ public static function testTemplateProvider()
{
$aReturn = array();
$aReturn['filter_system'] = [
- 'sFileName' => file_get_contents(__DIR__.'/test.html.twig'),
- 'expected' => file_get_contents(__DIR__.'/test.html'),
+ 'sFileName' => 'test.html',
+ 'expected' =>file_get_contents(dirname(__FILE__).'/test.html'),
];
return $aReturn;
diff --git a/test/twig/attacker/backdoor b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor
similarity index 100%
rename from test/twig/attacker/backdoor
rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor
diff --git a/test/twig/test.html b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html
similarity index 100%
rename from test/twig/test.html
rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html
diff --git a/test/twig/test.html.twig b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig
similarity index 100%
rename from test/twig/test.html.twig
rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig
diff --git a/test/application/search/CriterionConversionTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php
similarity index 100%
rename from test/application/search/CriterionConversionTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php
diff --git a/test/application/search/CriterionParserTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php
similarity index 100%
rename from test/application/search/CriterionParserTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php
diff --git a/test/application/search/SearchFormTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php
similarity index 100%
rename from test/application/search/SearchFormTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php
diff --git a/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php
new file mode 100644
index 000000000..e23b986cc
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php
@@ -0,0 +1,116 @@
+sAppRoot = __DIR__.'/../../../../../../sources/application/status';
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function testStatusGetAppRootWrongPath() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ $sAppRootFilenamewrong = 'approot.inc.php_wrong';
+
+ StatusGetAppRoot($sAppRootFilenamewrong);
+ }
+
+ /**
+ *
+ */
+ public function testStatusGetAppRootGood() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ StatusGetAppRoot();
+
+ $this->assertNotEmpty(APPROOT);
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function testStatusCheckConfigFileWrongPath() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ $sConfigFilenamewrong = 'config-itop.php_wrong';
+
+ StatusCheckConfigFile($sConfigFilenamewrong);
+ }
+
+ /**
+ *
+ */
+ public function testStatusCheckConfigFileGood() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ StatusCheckConfigFile();
+
+ $this->assertTrue(true);
+ }
+
+ /**
+ * @expectedException \MySQLException
+ */
+ public function testStatusStartupWrongDbPwd() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ StatusCheckConfigFile();
+ require_once(APPROOT . '/core/cmdbobject.class.inc.php');
+ require_once(APPROOT . '/application/utils.inc.php');
+ require_once(APPROOT . '/core/contexttag.class.inc.php');
+
+ $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE);
+ $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd') . '_unittest');
+
+ StatusStartup($oConfigWrong);
+ }
+
+ /**
+ *
+ */
+ public function testStatusStartupGood() {
+ include_once($this->sAppRoot . '/Status.php');
+
+ StatusStartup();
+
+ $this->assertTrue(true);
+ }
+
+}
diff --git a/test/status/StatusTest.php b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusTest.php
similarity index 100%
rename from test/status/StatusTest.php
rename to tests/php-unit-tests/unitary-tests/sources/application/status/StatusTest.php
diff --git a/tests/php-unit-tests/unitary-tests/sources/application/status/status.php b/tests/php-unit-tests/unitary-tests/sources/application/status/status.php
new file mode 100644
index 000000000..a97e2627c
--- /dev/null
+++ b/tests/php-unit-tests/unitary-tests/sources/application/status/status.php
@@ -0,0 +1,27 @@
+ STATUS_RUNNING, 'code' => \RestResult::OK, 'message' => '');
+}
+catch (\Exception $e)
+{
+ $iCode = (defined('\RestResult::INTERNAL_ERROR')) ? \RestResult::INTERNAL_ERROR : 100;
+ $aResult = array('status' => STATUS_ERROR, 'code' => $iCode, 'message' => $e->getMessage());
+ http_response_code(500);
+}
+
+//Set headers, based on webservices/rest.php
+$sContentType = 'application/json';
+header('Content-type: ' . $sContentType);
+header('Access-Control-Allow-Origin: *');
+
+//Output result
+$sResponse = json_encode($aResult);
+echo $sResponse;
diff --git a/test/synchro/DataSynchroTest.php b/tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php
similarity index 100%
rename from test/synchro/DataSynchroTest.php
rename to tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php
diff --git a/test/webservices/RestTest.php b/tests/php-unit-tests/unitary-tests/webservices/RestTest.php
similarity index 100%
rename from test/webservices/RestTest.php
rename to tests/php-unit-tests/unitary-tests/webservices/RestTest.php
diff --git a/tests/php-unit-tests/unittestautoload.php b/tests/php-unit-tests/unittestautoload.php
new file mode 100644
index 000000000..1e96a56bf
--- /dev/null
+++ b/tests/php-unit-tests/unittestautoload.php
@@ -0,0 +1,9 @@
+