From 1d7e4e1a42838285bbe7c119a5f4f6a91bd8c70d Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 13:07:57 +0200 Subject: [PATCH 01/31] =?UTF-8?q?N=C2=B05608=20-=20Move=20unit=20tests=20t?= =?UTF-8?q?o=20a=20dedicated=20folder=20and=20start=20reorganizing=20to=20?= =?UTF-8?q?match=20iTop=20folder=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- test/ci_description.ini | 2 +- .../{ => php-unit-tests}/ItopDataTestCase.php | 0 test/{ => php-unit-tests}/ItopTestCase.php | 0 test/{ => php-unit-tests}/composer.json | 0 .../DictionariesConsistencyTest.php | 0 .../iTopModulesPhpVersionChecklistTest.php | 0 .../iTopModulesXmlVersionChecklistTest.php | 0 test/{ => php-unit-tests}/phpunit.xml.dist | 24 +- .../postbuild_integration.xml.dist | 6 +- .../SetupCssIntegrityChecklistTest.php | 0 .../iTopDesignFormatChecklistTest.php | 0 ...iTopModuleXmlInstallationChecklistTest.php | 0 .../application/DashboardLayoutTest.php | 0 .../tests}/application/UtilsTest.php | 0 .../application/composer/iTopComposerTest.php | 0 .../application/privUITransactionFileTest.php | 0 .../search/CriterionConversionTest.php | 0 .../search/CriterionParserTest.php | 0 .../application/search/SearchFormTest.php | 0 .../tests}/core/BulkChangeTest.inc.php | 0 .../tests}/core/CMDBObjectTest.php | 0 .../tests}/core/CMDBSource/CMDBSourceTest.php | 0 .../core/CMDBSource/DeadLockInjection.php | 0 .../core/CMDBSource/TransactionsTest.php | 0 .../core/ConfigPlaceholdersResolverTest.php | 0 .../tests}/core/ConfigTest.php | 0 .../core/ConfigTest/config-itop-joker.php | 0 .../core/ConfigTest/config-itop-var.php | 0 .../config-itop_KO_config_plus_code.php | 0 .../config-itop_KO_function.php | 0 .../ConfigValidator/config-itop_VALID.php | 0 .../config-itop_VALID_log-level-min_const.php | 0 .../iTopConfigAstValidatorTest.php | 0 .../tests}/core/DBObjectTest.php | 0 .../tests}/core/DBSearchCommitTest.php | 0 .../tests}/core/DBSearchIntersectTest.php | 0 .../tests}/core/DBSearchJoinTest.php | 0 .../tests}/core/DBSearchTest.php | 0 .../core/DBSearchUpdateRealiasingMapTest.php | 0 .../tests}/core/ExpressionTest.php | 0 .../tests}/core/LogAPITest.php | 0 .../tests}/core/LogFileNameBuilderTest.php | 0 .../tests}/core/MetaModelTest.php | 0 .../tests}/core/OQLParserTest.php | 0 .../tests}/core/OQLTest.php | 0 .../tests}/core/TagSetFieldDataTest.php | 0 .../tests}/core/TriggerTest.php | 0 .../tests}/core/UniquenessConstraintTest.php | 0 .../tests}/core/UserRightsTest.php | 0 .../core/WeeklyScheduledProcessMockConfig.php | 0 .../core/WeeklyScheduledProcessTest.php | 0 .../tests}/core/apcEmulationTest.php | 0 .../tests}/core/dictApcuTest.php | 0 .../tests}/core/dictTest.php | 0 .../tests}/core/iTopConfigParserTest.php | 0 .../tests}/core/mockApcEmulation.incphp | 0 .../tests}/core/mockDict.incphp | 0 .../tests}/core/ormLinkSetTest.php | 0 .../tests}/core/ormTagSetTest.php | 0 .../sanitizer/AbstractDOMSanitizerTest.php | 0 .../core/sanitizer/HTMLDOMSanitizerTest.php | 0 .../tests}/core/sanitizer/InlineImageMock.php | 0 .../tests}/core/sanitizer/README.txt | 0 .../core/sanitizer/SvgDOMSanitizerTest.php | 0 .../tests}/core/sanitizer/input/scripts.html | 0 .../tests}/core/sanitizer/input/scripts.svg | 0 .../utf-8_wrong_character_email_truncated.txt | 0 .../core/sanitizer/input/whitelist_test.html | 0 .../tests}/core/sanitizer/output/scripts.html | 0 .../tests}/core/sanitizer/output/scripts.svg | 0 .../utf-8_wrong_character_email_truncated.txt | 0 .../tests}/coreExtensions/UserLocalTest.php | 0 .../UserLocalPasswordPolicyMock.php | 0 .../Validator/iTopConfigAstValidatorTest.php | 0 .../iTopConfigSyntaxValidatorTest.php | 0 .../2.x}/itop-tickets/itopTicketTest.php | 0 .../tests}/setup/DBBackupTest.php | 0 .../tests}/setup/SetupUtilsTest.php | 0 .../iTopDesignFormat/1.7_to_1.6.expected.xml | 0 .../iTopDesignFormat/1.7_to_1.6.input.xml | 0 .../iTopDesignFormat/iTopDesignFormatTest.php | 0 .../tests}/status/StatusIncTest.php | 0 .../tests}/status/StatusTest.php | 0 .../tests}/status/status.php | 0 .../tests}/webservices/RestTest.php | 0 .../{ => php-unit-tests}/unittestautoload.php | 0 {test => tests/php-unit-tests}/composer.lock | 435 ++---------------- 88 files changed, 52 insertions(+), 419 deletions(-) rename test/{ => php-unit-tests}/ItopDataTestCase.php (100%) rename test/{ => php-unit-tests}/ItopTestCase.php (100%) rename test/{ => php-unit-tests}/composer.json (100%) rename test/{ => php-unit-tests}/integration/DictionariesConsistencyTest.php (100%) rename test/{ => php-unit-tests}/integration/iTopModulesPhpVersionChecklistTest.php (100%) rename test/{ => php-unit-tests}/integration/iTopModulesXmlVersionChecklistTest.php (100%) rename test/{ => php-unit-tests}/phpunit.xml.dist (71%) rename test/{ => php-unit-tests}/postbuild_integration.xml.dist (84%) rename test/{ => php-unit-tests}/postbuild_integration/SetupCssIntegrityChecklistTest.php (100%) rename test/{ => php-unit-tests}/postbuild_integration/iTopDesignFormatChecklistTest.php (100%) rename test/{ => php-unit-tests}/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php (100%) rename test/{ => php-unit-tests/tests}/application/DashboardLayoutTest.php (100%) rename test/{ => php-unit-tests/tests}/application/UtilsTest.php (100%) rename test/{ => php-unit-tests/tests}/application/composer/iTopComposerTest.php (100%) rename test/{ => php-unit-tests/tests}/application/privUITransactionFileTest.php (100%) rename test/{ => php-unit-tests/tests}/application/search/CriterionConversionTest.php (100%) rename test/{ => php-unit-tests/tests}/application/search/CriterionParserTest.php (100%) rename test/{ => php-unit-tests/tests}/application/search/SearchFormTest.php (100%) rename test/{ => php-unit-tests/tests}/core/BulkChangeTest.inc.php (100%) rename test/{ => php-unit-tests/tests}/core/CMDBObjectTest.php (100%) rename test/{ => php-unit-tests/tests}/core/CMDBSource/CMDBSourceTest.php (100%) rename test/{ => php-unit-tests/tests}/core/CMDBSource/DeadLockInjection.php (100%) rename test/{ => php-unit-tests/tests}/core/CMDBSource/TransactionsTest.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigPlaceholdersResolverTest.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigTest.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigTest/config-itop-joker.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigTest/config-itop-var.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigValidator/config-itop_KO_config_plus_code.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigValidator/config-itop_KO_function.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigValidator/config-itop_VALID.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigValidator/config-itop_VALID_log-level-min_const.php (100%) rename test/{ => php-unit-tests/tests}/core/ConfigValidator/iTopConfigAstValidatorTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBObjectTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBSearchCommitTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBSearchIntersectTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBSearchJoinTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBSearchTest.php (100%) rename test/{ => php-unit-tests/tests}/core/DBSearchUpdateRealiasingMapTest.php (100%) rename test/{ => php-unit-tests/tests}/core/ExpressionTest.php (100%) rename test/{ => php-unit-tests/tests}/core/LogAPITest.php (100%) rename test/{ => php-unit-tests/tests}/core/LogFileNameBuilderTest.php (100%) rename test/{ => php-unit-tests/tests}/core/MetaModelTest.php (100%) rename test/{ => php-unit-tests/tests}/core/OQLParserTest.php (100%) rename test/{ => php-unit-tests/tests}/core/OQLTest.php (100%) rename test/{ => php-unit-tests/tests}/core/TagSetFieldDataTest.php (100%) rename test/{ => php-unit-tests/tests}/core/TriggerTest.php (100%) rename test/{ => php-unit-tests/tests}/core/UniquenessConstraintTest.php (100%) rename test/{ => php-unit-tests/tests}/core/UserRightsTest.php (100%) rename test/{ => php-unit-tests/tests}/core/WeeklyScheduledProcessMockConfig.php (100%) rename test/{ => php-unit-tests/tests}/core/WeeklyScheduledProcessTest.php (100%) rename test/{ => php-unit-tests/tests}/core/apcEmulationTest.php (100%) rename test/{ => php-unit-tests/tests}/core/dictApcuTest.php (100%) rename test/{ => php-unit-tests/tests}/core/dictTest.php (100%) rename test/{ => php-unit-tests/tests}/core/iTopConfigParserTest.php (100%) rename test/{ => php-unit-tests/tests}/core/mockApcEmulation.incphp (100%) rename test/{ => php-unit-tests/tests}/core/mockDict.incphp (100%) rename test/{ => php-unit-tests/tests}/core/ormLinkSetTest.php (100%) rename test/{ => php-unit-tests/tests}/core/ormTagSetTest.php (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/AbstractDOMSanitizerTest.php (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/HTMLDOMSanitizerTest.php (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/InlineImageMock.php (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/README.txt (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/SvgDOMSanitizerTest.php (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/input/scripts.html (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/input/scripts.svg (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/input/whitelist_test.html (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/output/scripts.html (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/output/scripts.svg (100%) rename test/{ => php-unit-tests/tests}/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt (100%) rename test/{ => php-unit-tests/tests}/coreExtensions/UserLocalTest.php (100%) rename test/{ => php-unit-tests/tests}/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php (100%) rename test/{ => php-unit-tests/tests/datamodels/2.x}/itop-config/Validator/iTopConfigAstValidatorTest.php (100%) rename test/{ => php-unit-tests/tests/datamodels/2.x}/itop-config/Validator/iTopConfigSyntaxValidatorTest.php (100%) rename test/{ => php-unit-tests/tests/datamodels/2.x}/itop-tickets/itopTicketTest.php (100%) rename test/{ => php-unit-tests/tests}/setup/DBBackupTest.php (100%) rename test/{ => php-unit-tests/tests}/setup/SetupUtilsTest.php (100%) rename test/{ => php-unit-tests/tests}/setup/iTopDesignFormat/1.7_to_1.6.expected.xml (100%) rename test/{ => php-unit-tests/tests}/setup/iTopDesignFormat/1.7_to_1.6.input.xml (100%) rename test/{ => php-unit-tests/tests}/setup/iTopDesignFormat/iTopDesignFormatTest.php (100%) rename test/{ => php-unit-tests/tests}/status/StatusIncTest.php (100%) rename test/{ => php-unit-tests/tests}/status/StatusTest.php (100%) rename test/{ => php-unit-tests/tests}/status/status.php (100%) rename test/{ => php-unit-tests/tests}/webservices/RestTest.php (100%) rename test/{ => php-unit-tests}/unittestautoload.php (100%) rename {test => tests/php-unit-tests}/composer.lock (77%) diff --git a/.gitignore b/.gitignore index 1fe7f38f4..8a46f7b20 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ # composer reserver directory, from sources, populate/update using "composer install" vendor/* -test/vendor/* +test/*/vendor/* # all conf but listing prevention /conf/** @@ -33,7 +33,7 @@ test/vendor/* !/log/web.config # PHPUnit cache file -/test/.phpunit.result.cache +/test/php-unit-tests/.phpunit.result.cache # Jetbrains diff --git a/test/ci_description.ini b/test/ci_description.ini index dfa005287..ed14d2c87 100644 --- a/test/ci_description.ini +++ b/test/ci_description.ini @@ -5,4 +5,4 @@ itop_backup=test/backups/backup-itop.tar.gz [phpunit] ; when empty phpunit_xml => no phpunit test performed ; phpunit xml file description. required for phpunit testing -phpunit_xml=test/phpunit.xml.dist +phpunit_xml=test/php-unit-tests/phpunit.xml.dist diff --git a/test/ItopDataTestCase.php b/test/php-unit-tests/ItopDataTestCase.php similarity index 100% rename from test/ItopDataTestCase.php rename to test/php-unit-tests/ItopDataTestCase.php diff --git a/test/ItopTestCase.php b/test/php-unit-tests/ItopTestCase.php similarity index 100% rename from test/ItopTestCase.php rename to test/php-unit-tests/ItopTestCase.php diff --git a/test/composer.json b/test/php-unit-tests/composer.json similarity index 100% rename from test/composer.json rename to test/php-unit-tests/composer.json diff --git a/test/integration/DictionariesConsistencyTest.php b/test/php-unit-tests/integration/DictionariesConsistencyTest.php similarity index 100% rename from test/integration/DictionariesConsistencyTest.php rename to test/php-unit-tests/integration/DictionariesConsistencyTest.php diff --git a/test/integration/iTopModulesPhpVersionChecklistTest.php b/test/php-unit-tests/integration/iTopModulesPhpVersionChecklistTest.php similarity index 100% rename from test/integration/iTopModulesPhpVersionChecklistTest.php rename to test/php-unit-tests/integration/iTopModulesPhpVersionChecklistTest.php diff --git a/test/integration/iTopModulesXmlVersionChecklistTest.php b/test/php-unit-tests/integration/iTopModulesXmlVersionChecklistTest.php similarity index 100% rename from test/integration/iTopModulesXmlVersionChecklistTest.php rename to test/php-unit-tests/integration/iTopModulesXmlVersionChecklistTest.php diff --git a/test/phpunit.xml.dist b/test/php-unit-tests/phpunit.xml.dist similarity index 71% rename from test/phpunit.xml.dist rename to test/php-unit-tests/phpunit.xml.dist index a836dbd9a..703b2b363 100644 --- a/test/phpunit.xml.dist +++ b/test/php-unit-tests/phpunit.xml.dist @@ -29,44 +29,44 @@ - application + tests/application - core + tests/core - coreExtensions + tests/coreExtensions integration - itop-config + tests/datamodels/2.x/itop-config - itop-tickets + tests/datamodels/2.x/itop-tickets - setup + tests/setup - status + tests/status - webservices + tests/webservices - ../env-production/*/test + ../../../env-production/*/test - ../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.xml.dist b/test/php-unit-tests/postbuild_integration.xml.dist similarity index 84% rename from test/postbuild_integration.xml.dist rename to test/php-unit-tests/postbuild_integration.xml.dist index 5e701b93d..2032e204e 100644 --- a/test/postbuild_integration.xml.dist +++ b/test/php-unit-tests/postbuild_integration.xml.dist @@ -34,9 +34,9 @@ - ../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/test/php-unit-tests/postbuild_integration/SetupCssIntegrityChecklistTest.php similarity index 100% rename from test/postbuild_integration/SetupCssIntegrityChecklistTest.php rename to test/php-unit-tests/postbuild_integration/SetupCssIntegrityChecklistTest.php diff --git a/test/postbuild_integration/iTopDesignFormatChecklistTest.php b/test/php-unit-tests/postbuild_integration/iTopDesignFormatChecklistTest.php similarity index 100% rename from test/postbuild_integration/iTopDesignFormatChecklistTest.php rename to test/php-unit-tests/postbuild_integration/iTopDesignFormatChecklistTest.php diff --git a/test/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php b/test/php-unit-tests/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php similarity index 100% rename from test/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php rename to test/php-unit-tests/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php diff --git a/test/application/DashboardLayoutTest.php b/test/php-unit-tests/tests/application/DashboardLayoutTest.php similarity index 100% rename from test/application/DashboardLayoutTest.php rename to test/php-unit-tests/tests/application/DashboardLayoutTest.php diff --git a/test/application/UtilsTest.php b/test/php-unit-tests/tests/application/UtilsTest.php similarity index 100% rename from test/application/UtilsTest.php rename to test/php-unit-tests/tests/application/UtilsTest.php diff --git a/test/application/composer/iTopComposerTest.php b/test/php-unit-tests/tests/application/composer/iTopComposerTest.php similarity index 100% rename from test/application/composer/iTopComposerTest.php rename to test/php-unit-tests/tests/application/composer/iTopComposerTest.php diff --git a/test/application/privUITransactionFileTest.php b/test/php-unit-tests/tests/application/privUITransactionFileTest.php similarity index 100% rename from test/application/privUITransactionFileTest.php rename to test/php-unit-tests/tests/application/privUITransactionFileTest.php diff --git a/test/application/search/CriterionConversionTest.php b/test/php-unit-tests/tests/application/search/CriterionConversionTest.php similarity index 100% rename from test/application/search/CriterionConversionTest.php rename to test/php-unit-tests/tests/application/search/CriterionConversionTest.php diff --git a/test/application/search/CriterionParserTest.php b/test/php-unit-tests/tests/application/search/CriterionParserTest.php similarity index 100% rename from test/application/search/CriterionParserTest.php rename to test/php-unit-tests/tests/application/search/CriterionParserTest.php diff --git a/test/application/search/SearchFormTest.php b/test/php-unit-tests/tests/application/search/SearchFormTest.php similarity index 100% rename from test/application/search/SearchFormTest.php rename to test/php-unit-tests/tests/application/search/SearchFormTest.php diff --git a/test/core/BulkChangeTest.inc.php b/test/php-unit-tests/tests/core/BulkChangeTest.inc.php similarity index 100% rename from test/core/BulkChangeTest.inc.php rename to test/php-unit-tests/tests/core/BulkChangeTest.inc.php diff --git a/test/core/CMDBObjectTest.php b/test/php-unit-tests/tests/core/CMDBObjectTest.php similarity index 100% rename from test/core/CMDBObjectTest.php rename to test/php-unit-tests/tests/core/CMDBObjectTest.php diff --git a/test/core/CMDBSource/CMDBSourceTest.php b/test/php-unit-tests/tests/core/CMDBSource/CMDBSourceTest.php similarity index 100% rename from test/core/CMDBSource/CMDBSourceTest.php rename to test/php-unit-tests/tests/core/CMDBSource/CMDBSourceTest.php diff --git a/test/core/CMDBSource/DeadLockInjection.php b/test/php-unit-tests/tests/core/CMDBSource/DeadLockInjection.php similarity index 100% rename from test/core/CMDBSource/DeadLockInjection.php rename to test/php-unit-tests/tests/core/CMDBSource/DeadLockInjection.php diff --git a/test/core/CMDBSource/TransactionsTest.php b/test/php-unit-tests/tests/core/CMDBSource/TransactionsTest.php similarity index 100% rename from test/core/CMDBSource/TransactionsTest.php rename to test/php-unit-tests/tests/core/CMDBSource/TransactionsTest.php diff --git a/test/core/ConfigPlaceholdersResolverTest.php b/test/php-unit-tests/tests/core/ConfigPlaceholdersResolverTest.php similarity index 100% rename from test/core/ConfigPlaceholdersResolverTest.php rename to test/php-unit-tests/tests/core/ConfigPlaceholdersResolverTest.php diff --git a/test/core/ConfigTest.php b/test/php-unit-tests/tests/core/ConfigTest.php similarity index 100% rename from test/core/ConfigTest.php rename to test/php-unit-tests/tests/core/ConfigTest.php diff --git a/test/core/ConfigTest/config-itop-joker.php b/test/php-unit-tests/tests/core/ConfigTest/config-itop-joker.php similarity index 100% rename from test/core/ConfigTest/config-itop-joker.php rename to test/php-unit-tests/tests/core/ConfigTest/config-itop-joker.php diff --git a/test/core/ConfigTest/config-itop-var.php b/test/php-unit-tests/tests/core/ConfigTest/config-itop-var.php similarity index 100% rename from test/core/ConfigTest/config-itop-var.php rename to test/php-unit-tests/tests/core/ConfigTest/config-itop-var.php diff --git a/test/core/ConfigValidator/config-itop_KO_config_plus_code.php b/test/php-unit-tests/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 test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_config_plus_code.php diff --git a/test/core/ConfigValidator/config-itop_KO_function.php b/test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_function.php similarity index 100% rename from test/core/ConfigValidator/config-itop_KO_function.php rename to test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_function.php diff --git a/test/core/ConfigValidator/config-itop_VALID.php b/test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID.php similarity index 100% rename from test/core/ConfigValidator/config-itop_VALID.php rename to test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID.php diff --git a/test/core/ConfigValidator/config-itop_VALID_log-level-min_const.php b/test/php-unit-tests/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 test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php diff --git a/test/core/ConfigValidator/iTopConfigAstValidatorTest.php b/test/php-unit-tests/tests/core/ConfigValidator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/core/ConfigValidator/iTopConfigAstValidatorTest.php rename to test/php-unit-tests/tests/core/ConfigValidator/iTopConfigAstValidatorTest.php diff --git a/test/core/DBObjectTest.php b/test/php-unit-tests/tests/core/DBObjectTest.php similarity index 100% rename from test/core/DBObjectTest.php rename to test/php-unit-tests/tests/core/DBObjectTest.php diff --git a/test/core/DBSearchCommitTest.php b/test/php-unit-tests/tests/core/DBSearchCommitTest.php similarity index 100% rename from test/core/DBSearchCommitTest.php rename to test/php-unit-tests/tests/core/DBSearchCommitTest.php diff --git a/test/core/DBSearchIntersectTest.php b/test/php-unit-tests/tests/core/DBSearchIntersectTest.php similarity index 100% rename from test/core/DBSearchIntersectTest.php rename to test/php-unit-tests/tests/core/DBSearchIntersectTest.php diff --git a/test/core/DBSearchJoinTest.php b/test/php-unit-tests/tests/core/DBSearchJoinTest.php similarity index 100% rename from test/core/DBSearchJoinTest.php rename to test/php-unit-tests/tests/core/DBSearchJoinTest.php diff --git a/test/core/DBSearchTest.php b/test/php-unit-tests/tests/core/DBSearchTest.php similarity index 100% rename from test/core/DBSearchTest.php rename to test/php-unit-tests/tests/core/DBSearchTest.php diff --git a/test/core/DBSearchUpdateRealiasingMapTest.php b/test/php-unit-tests/tests/core/DBSearchUpdateRealiasingMapTest.php similarity index 100% rename from test/core/DBSearchUpdateRealiasingMapTest.php rename to test/php-unit-tests/tests/core/DBSearchUpdateRealiasingMapTest.php diff --git a/test/core/ExpressionTest.php b/test/php-unit-tests/tests/core/ExpressionTest.php similarity index 100% rename from test/core/ExpressionTest.php rename to test/php-unit-tests/tests/core/ExpressionTest.php diff --git a/test/core/LogAPITest.php b/test/php-unit-tests/tests/core/LogAPITest.php similarity index 100% rename from test/core/LogAPITest.php rename to test/php-unit-tests/tests/core/LogAPITest.php diff --git a/test/core/LogFileNameBuilderTest.php b/test/php-unit-tests/tests/core/LogFileNameBuilderTest.php similarity index 100% rename from test/core/LogFileNameBuilderTest.php rename to test/php-unit-tests/tests/core/LogFileNameBuilderTest.php diff --git a/test/core/MetaModelTest.php b/test/php-unit-tests/tests/core/MetaModelTest.php similarity index 100% rename from test/core/MetaModelTest.php rename to test/php-unit-tests/tests/core/MetaModelTest.php diff --git a/test/core/OQLParserTest.php b/test/php-unit-tests/tests/core/OQLParserTest.php similarity index 100% rename from test/core/OQLParserTest.php rename to test/php-unit-tests/tests/core/OQLParserTest.php diff --git a/test/core/OQLTest.php b/test/php-unit-tests/tests/core/OQLTest.php similarity index 100% rename from test/core/OQLTest.php rename to test/php-unit-tests/tests/core/OQLTest.php diff --git a/test/core/TagSetFieldDataTest.php b/test/php-unit-tests/tests/core/TagSetFieldDataTest.php similarity index 100% rename from test/core/TagSetFieldDataTest.php rename to test/php-unit-tests/tests/core/TagSetFieldDataTest.php diff --git a/test/core/TriggerTest.php b/test/php-unit-tests/tests/core/TriggerTest.php similarity index 100% rename from test/core/TriggerTest.php rename to test/php-unit-tests/tests/core/TriggerTest.php diff --git a/test/core/UniquenessConstraintTest.php b/test/php-unit-tests/tests/core/UniquenessConstraintTest.php similarity index 100% rename from test/core/UniquenessConstraintTest.php rename to test/php-unit-tests/tests/core/UniquenessConstraintTest.php diff --git a/test/core/UserRightsTest.php b/test/php-unit-tests/tests/core/UserRightsTest.php similarity index 100% rename from test/core/UserRightsTest.php rename to test/php-unit-tests/tests/core/UserRightsTest.php diff --git a/test/core/WeeklyScheduledProcessMockConfig.php b/test/php-unit-tests/tests/core/WeeklyScheduledProcessMockConfig.php similarity index 100% rename from test/core/WeeklyScheduledProcessMockConfig.php rename to test/php-unit-tests/tests/core/WeeklyScheduledProcessMockConfig.php diff --git a/test/core/WeeklyScheduledProcessTest.php b/test/php-unit-tests/tests/core/WeeklyScheduledProcessTest.php similarity index 100% rename from test/core/WeeklyScheduledProcessTest.php rename to test/php-unit-tests/tests/core/WeeklyScheduledProcessTest.php diff --git a/test/core/apcEmulationTest.php b/test/php-unit-tests/tests/core/apcEmulationTest.php similarity index 100% rename from test/core/apcEmulationTest.php rename to test/php-unit-tests/tests/core/apcEmulationTest.php diff --git a/test/core/dictApcuTest.php b/test/php-unit-tests/tests/core/dictApcuTest.php similarity index 100% rename from test/core/dictApcuTest.php rename to test/php-unit-tests/tests/core/dictApcuTest.php diff --git a/test/core/dictTest.php b/test/php-unit-tests/tests/core/dictTest.php similarity index 100% rename from test/core/dictTest.php rename to test/php-unit-tests/tests/core/dictTest.php diff --git a/test/core/iTopConfigParserTest.php b/test/php-unit-tests/tests/core/iTopConfigParserTest.php similarity index 100% rename from test/core/iTopConfigParserTest.php rename to test/php-unit-tests/tests/core/iTopConfigParserTest.php diff --git a/test/core/mockApcEmulation.incphp b/test/php-unit-tests/tests/core/mockApcEmulation.incphp similarity index 100% rename from test/core/mockApcEmulation.incphp rename to test/php-unit-tests/tests/core/mockApcEmulation.incphp diff --git a/test/core/mockDict.incphp b/test/php-unit-tests/tests/core/mockDict.incphp similarity index 100% rename from test/core/mockDict.incphp rename to test/php-unit-tests/tests/core/mockDict.incphp diff --git a/test/core/ormLinkSetTest.php b/test/php-unit-tests/tests/core/ormLinkSetTest.php similarity index 100% rename from test/core/ormLinkSetTest.php rename to test/php-unit-tests/tests/core/ormLinkSetTest.php diff --git a/test/core/ormTagSetTest.php b/test/php-unit-tests/tests/core/ormTagSetTest.php similarity index 100% rename from test/core/ormTagSetTest.php rename to test/php-unit-tests/tests/core/ormTagSetTest.php diff --git a/test/core/sanitizer/AbstractDOMSanitizerTest.php b/test/php-unit-tests/tests/core/sanitizer/AbstractDOMSanitizerTest.php similarity index 100% rename from test/core/sanitizer/AbstractDOMSanitizerTest.php rename to test/php-unit-tests/tests/core/sanitizer/AbstractDOMSanitizerTest.php diff --git a/test/core/sanitizer/HTMLDOMSanitizerTest.php b/test/php-unit-tests/tests/core/sanitizer/HTMLDOMSanitizerTest.php similarity index 100% rename from test/core/sanitizer/HTMLDOMSanitizerTest.php rename to test/php-unit-tests/tests/core/sanitizer/HTMLDOMSanitizerTest.php diff --git a/test/core/sanitizer/InlineImageMock.php b/test/php-unit-tests/tests/core/sanitizer/InlineImageMock.php similarity index 100% rename from test/core/sanitizer/InlineImageMock.php rename to test/php-unit-tests/tests/core/sanitizer/InlineImageMock.php diff --git a/test/core/sanitizer/README.txt b/test/php-unit-tests/tests/core/sanitizer/README.txt similarity index 100% rename from test/core/sanitizer/README.txt rename to test/php-unit-tests/tests/core/sanitizer/README.txt diff --git a/test/core/sanitizer/SvgDOMSanitizerTest.php b/test/php-unit-tests/tests/core/sanitizer/SvgDOMSanitizerTest.php similarity index 100% rename from test/core/sanitizer/SvgDOMSanitizerTest.php rename to test/php-unit-tests/tests/core/sanitizer/SvgDOMSanitizerTest.php diff --git a/test/core/sanitizer/input/scripts.html b/test/php-unit-tests/tests/core/sanitizer/input/scripts.html similarity index 100% rename from test/core/sanitizer/input/scripts.html rename to test/php-unit-tests/tests/core/sanitizer/input/scripts.html diff --git a/test/core/sanitizer/input/scripts.svg b/test/php-unit-tests/tests/core/sanitizer/input/scripts.svg similarity index 100% rename from test/core/sanitizer/input/scripts.svg rename to test/php-unit-tests/tests/core/sanitizer/input/scripts.svg diff --git a/test/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt b/test/php-unit-tests/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 test/php-unit-tests/tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt diff --git a/test/core/sanitizer/input/whitelist_test.html b/test/php-unit-tests/tests/core/sanitizer/input/whitelist_test.html similarity index 100% rename from test/core/sanitizer/input/whitelist_test.html rename to test/php-unit-tests/tests/core/sanitizer/input/whitelist_test.html diff --git a/test/core/sanitizer/output/scripts.html b/test/php-unit-tests/tests/core/sanitizer/output/scripts.html similarity index 100% rename from test/core/sanitizer/output/scripts.html rename to test/php-unit-tests/tests/core/sanitizer/output/scripts.html diff --git a/test/core/sanitizer/output/scripts.svg b/test/php-unit-tests/tests/core/sanitizer/output/scripts.svg similarity index 100% rename from test/core/sanitizer/output/scripts.svg rename to test/php-unit-tests/tests/core/sanitizer/output/scripts.svg diff --git a/test/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt b/test/php-unit-tests/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 test/php-unit-tests/tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt diff --git a/test/coreExtensions/UserLocalTest.php b/test/php-unit-tests/tests/coreExtensions/UserLocalTest.php similarity index 100% rename from test/coreExtensions/UserLocalTest.php rename to test/php-unit-tests/tests/coreExtensions/UserLocalTest.php diff --git a/test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php b/test/php-unit-tests/tests/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php similarity index 100% rename from test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php rename to test/php-unit-tests/tests/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php diff --git a/test/itop-config/Validator/iTopConfigAstValidatorTest.php b/test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/itop-config/Validator/iTopConfigAstValidatorTest.php rename to test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php diff --git a/test/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php similarity index 100% rename from test/itop-config/Validator/iTopConfigSyntaxValidatorTest.php rename to test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php diff --git a/test/itop-tickets/itopTicketTest.php b/test/php-unit-tests/tests/datamodels/2.x/itop-tickets/itopTicketTest.php similarity index 100% rename from test/itop-tickets/itopTicketTest.php rename to test/php-unit-tests/tests/datamodels/2.x/itop-tickets/itopTicketTest.php diff --git a/test/setup/DBBackupTest.php b/test/php-unit-tests/tests/setup/DBBackupTest.php similarity index 100% rename from test/setup/DBBackupTest.php rename to test/php-unit-tests/tests/setup/DBBackupTest.php diff --git a/test/setup/SetupUtilsTest.php b/test/php-unit-tests/tests/setup/SetupUtilsTest.php similarity index 100% rename from test/setup/SetupUtilsTest.php rename to test/php-unit-tests/tests/setup/SetupUtilsTest.php diff --git a/test/setup/iTopDesignFormat/1.7_to_1.6.expected.xml b/test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml similarity index 100% rename from test/setup/iTopDesignFormat/1.7_to_1.6.expected.xml rename to test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml diff --git a/test/setup/iTopDesignFormat/1.7_to_1.6.input.xml b/test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml similarity index 100% rename from test/setup/iTopDesignFormat/1.7_to_1.6.input.xml rename to test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml diff --git a/test/setup/iTopDesignFormat/iTopDesignFormatTest.php b/test/php-unit-tests/tests/setup/iTopDesignFormat/iTopDesignFormatTest.php similarity index 100% rename from test/setup/iTopDesignFormat/iTopDesignFormatTest.php rename to test/php-unit-tests/tests/setup/iTopDesignFormat/iTopDesignFormatTest.php diff --git a/test/status/StatusIncTest.php b/test/php-unit-tests/tests/status/StatusIncTest.php similarity index 100% rename from test/status/StatusIncTest.php rename to test/php-unit-tests/tests/status/StatusIncTest.php diff --git a/test/status/StatusTest.php b/test/php-unit-tests/tests/status/StatusTest.php similarity index 100% rename from test/status/StatusTest.php rename to test/php-unit-tests/tests/status/StatusTest.php diff --git a/test/status/status.php b/test/php-unit-tests/tests/status/status.php similarity index 100% rename from test/status/status.php rename to test/php-unit-tests/tests/status/status.php diff --git a/test/webservices/RestTest.php b/test/php-unit-tests/tests/webservices/RestTest.php similarity index 100% rename from test/webservices/RestTest.php rename to test/php-unit-tests/tests/webservices/RestTest.php diff --git a/test/unittestautoload.php b/test/php-unit-tests/unittestautoload.php similarity index 100% rename from test/unittestautoload.php rename to test/php-unit-tests/unittestautoload.php diff --git a/test/composer.lock b/tests/php-unit-tests/composer.lock similarity index 77% rename from test/composer.lock rename to tests/php-unit-tests/composer.lock index 1dadb48f1..28f127346 100644 --- a/test/composer.lock +++ b/tests/php-unit-tests/composer.lock @@ -247,233 +247,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpunit/php-code-coverage", "version": "7.0.15", @@ -713,29 +486,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "4.0.4", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -760,7 +533,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" }, "funding": [ { @@ -769,20 +542,20 @@ } ], "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" + "time": "2021-07-26T12:15:06+00:00" }, { "name": "phpunit/phpunit", - "version": "8.5.26", + "version": "8.5.30", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ef117c59fc4c54a979021b26d08a3373e386606d" + "reference": "4fd448df9affda65a5faa58f8b93087d415216ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef117c59fc4c54a979021b26d08a3373e386606d", - "reference": "ef117c59fc4c54a979021b26d08a3373e386606d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4fd448df9affda65a5faa58f8b93087d415216ce", + "reference": "4fd448df9affda65a5faa58f8b93087d415216ce", "shasum": "" }, "require": { @@ -797,24 +570,20 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", "phpunit/php-code-coverage": "^7.0.12", "phpunit/php-file-iterator": "^2.0.4", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", + "sebastian/comparator": "^3.0.5", "sebastian/diff": "^3.0.2", "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", + "sebastian/exporter": "^3.1.5", "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^2.0.1", "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "require-dev": { - "ext-pdo": "*" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", @@ -854,7 +623,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.30" }, "funding": [ { @@ -864,9 +633,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-04-01T12:34:39+00:00" + "time": "2022-09-25T03:43:00+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -925,16 +698,16 @@ }, { "name": "sebastian/comparator", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", "shasum": "" }, "require": { @@ -987,7 +760,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" }, "funding": [ { @@ -995,7 +768,7 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2022-09-14T12:31:48+00:00" }, { "name": "sebastian/diff", @@ -1128,16 +901,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "3.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", "shasum": "" }, "require": { @@ -1193,7 +966,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" }, "funding": [ { @@ -1201,7 +974,7 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2022-09-14T06:00:17+00:00" }, { "name": "sebastian/global-state", @@ -1635,88 +1408,6 @@ }, "time": "2021-01-04T13:25:10+00:00" }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-20T20:35:02+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -1766,64 +1457,6 @@ } ], "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -1833,5 +1466,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } From c06cbfd4a934a795179803a5b0348bffc62354cb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 13:21:28 +0200 Subject: [PATCH 02/31] =?UTF-8?q?N=C2=B05608=20-=20Rename=20"coreExtension?= =?UTF-8?q?s"=20test=20suite=20to=20correct=20datamodel=20module=20(authen?= =?UTF-8?q?t-local)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/php-unit-tests/phpunit.xml.dist | 6 +++--- .../2.x/authent-local}/UserLocalTest.php | 2 +- .../UserLocalTest/UserLocalPasswordPolicyMock.php | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename test/php-unit-tests/tests/{coreExtensions => datamodels/2.x/authent-local}/UserLocalTest.php (98%) rename test/php-unit-tests/tests/{coreExtensions => datamodels/2.x/authent-local}/UserLocalTest/UserLocalPasswordPolicyMock.php (100%) diff --git a/test/php-unit-tests/phpunit.xml.dist b/test/php-unit-tests/phpunit.xml.dist index 703b2b363..450a4cc2e 100644 --- a/test/php-unit-tests/phpunit.xml.dist +++ b/test/php-unit-tests/phpunit.xml.dist @@ -34,12 +34,12 @@ tests/core - - tests/coreExtensions - integration + + tests/datamodels/2.x/authent-local + tests/datamodels/2.x/itop-config diff --git a/test/php-unit-tests/tests/coreExtensions/UserLocalTest.php b/test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest.php similarity index 98% rename from test/php-unit-tests/tests/coreExtensions/UserLocalTest.php rename to test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest.php index 889a44813..b82eeee6b 100644 --- a/test/php-unit-tests/tests/coreExtensions/UserLocalTest.php +++ b/test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest.php @@ -25,7 +25,7 @@ class UserLocalTest extends ItopDataTestCase { parent::setUp(); - require_once(APPROOT.'test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php'); + require_once(APPROOT.'test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); require_once(APPROOT.'env-production/authent-local/model.authent-local.php'); } diff --git a/test/php-unit-tests/tests/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php b/test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php similarity index 100% rename from test/php-unit-tests/tests/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php rename to test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php From a3e309acb515848f0b2ee1f703396610e4769407 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 14:31:53 +0200 Subject: [PATCH 03/31] =?UTF-8?q?N=C2=B05608=20-=20Revert=20"authent-local?= =?UTF-8?q?"=20test=20suite=20to=20its=20original=20rank=20as=20it=20is=20?= =?UTF-8?q?crashing=20the=20CI=20=F0=9F=A4=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/php-unit-tests/phpunit.xml.dist | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/php-unit-tests/phpunit.xml.dist b/test/php-unit-tests/phpunit.xml.dist index 450a4cc2e..6bc9513a3 100644 --- a/test/php-unit-tests/phpunit.xml.dist +++ b/test/php-unit-tests/phpunit.xml.dist @@ -34,12 +34,13 @@ tests/core - - integration - + tests/datamodels/2.x/authent-local + + integration + tests/datamodels/2.x/itop-config From d9539f9d01d23c335b3805fb755e975bb86cda61 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 19:55:44 +0200 Subject: [PATCH 04/31] =?UTF-8?q?N=C2=B05608=20-=20Add=20comments=20to=20m?= =?UTF-8?q?ain=20autoloader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/php-unit-tests/unittestautoload.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/php-unit-tests/unittestautoload.php b/test/php-unit-tests/unittestautoload.php index fcc03e10b..1e96a56bf 100644 --- a/test/php-unit-tests/unittestautoload.php +++ b/test/php-unit-tests/unittestautoload.php @@ -1,5 +1,9 @@ Date: Thu, 13 Oct 2022 20:04:48 +0200 Subject: [PATCH 05/31] =?UTF-8?q?N=C2=B05608=20-=20Rename=20"VisualTests"?= =?UTF-8?q?=20folder=20to=20match=20new=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attributeset_widget_poc.html | 0 test/{VisualTest => manual-visual-tests}/sanitize_test.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/{VisualTest => manual-visual-tests}/attributeset_widget_poc.html (100%) rename test/{VisualTest => manual-visual-tests}/sanitize_test.php (100%) diff --git a/test/VisualTest/attributeset_widget_poc.html b/test/manual-visual-tests/attributeset_widget_poc.html similarity index 100% rename from test/VisualTest/attributeset_widget_poc.html rename to test/manual-visual-tests/attributeset_widget_poc.html diff --git a/test/VisualTest/sanitize_test.php b/test/manual-visual-tests/sanitize_test.php similarity index 100% rename from test/VisualTest/sanitize_test.php rename to test/manual-visual-tests/sanitize_test.php From 4f88a0e7d2693ab49423e2d515911e3c149452ab Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 20:59:02 +0200 Subject: [PATCH 06/31] =?UTF-8?q?N=C2=B05608=20-=20Move=20legacy=20PHP=20u?= =?UTF-8?q?nit=20tests=20(not=20run=20by=20CI)=20to=20a=20dedicated=20fold?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/{ => php-unit-tests/legacy-tests}/GroupByAndFunctions.php | 2 +- test/{ => php-unit-tests/legacy-tests}/VerifyOQL.php | 2 +- test/{ => php-unit-tests/legacy-tests}/benchmark.php | 2 +- test/{ => php-unit-tests/legacy-tests}/build_test_oql.php | 2 +- test/{ => php-unit-tests/legacy-tests}/config-test-farm.php | 0 .../{ => php-unit-tests/legacy-tests}/display_cache_content.php | 2 +- test/{ => php-unit-tests/legacy-tests}/replay_query_log.php | 2 +- test/{ => php-unit-tests/legacy-tests}/test.class.inc.php | 0 test/{ => php-unit-tests/legacy-tests}/test.php | 2 +- test/{ => php-unit-tests/legacy-tests}/testlist.inc.php | 0 10 files changed, 7 insertions(+), 7 deletions(-) rename test/{ => php-unit-tests/legacy-tests}/GroupByAndFunctions.php (99%) rename test/{ => php-unit-tests/legacy-tests}/VerifyOQL.php (99%) rename test/{ => php-unit-tests/legacy-tests}/benchmark.php (99%) rename test/{ => php-unit-tests/legacy-tests}/build_test_oql.php (98%) rename test/{ => php-unit-tests/legacy-tests}/config-test-farm.php (100%) rename test/{ => php-unit-tests/legacy-tests}/display_cache_content.php (98%) rename test/{ => php-unit-tests/legacy-tests}/replay_query_log.php (99%) rename test/{ => php-unit-tests/legacy-tests}/test.class.inc.php (100%) rename test/{ => php-unit-tests/legacy-tests}/test.php (98%) rename test/{ => php-unit-tests/legacy-tests}/testlist.inc.php (100%) diff --git a/test/GroupByAndFunctions.php b/test/php-unit-tests/legacy-tests/GroupByAndFunctions.php similarity index 99% rename from test/GroupByAndFunctions.php rename to test/php-unit-tests/legacy-tests/GroupByAndFunctions.php index ffb1c4862..8806dd737 100644 --- a/test/GroupByAndFunctions.php +++ b/test/php-unit-tests/legacy-tests/GroupByAndFunctions.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/itopwebpage.class.inc.php'); require_once(APPROOT.'application/startup.inc.php'); diff --git a/test/VerifyOQL.php b/test/php-unit-tests/legacy-tests/VerifyOQL.php similarity index 99% rename from test/VerifyOQL.php rename to test/php-unit-tests/legacy-tests/VerifyOQL.php index e9da8e82c..3d07eba31 100644 --- a/test/VerifyOQL.php +++ b/test/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/itopwebpage.class.inc.php'); require_once(APPROOT.'/application/startup.inc.php'); diff --git a/test/benchmark.php b/test/php-unit-tests/legacy-tests/benchmark.php similarity index 99% rename from test/benchmark.php rename to test/php-unit-tests/legacy-tests/benchmark.php index 1f5d9428e..26f5dbb70 100644 --- a/test/benchmark.php +++ b/test/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/itopwebpage.class.inc.php'); require_once(APPROOT.'/application/wizardhelper.class.inc.php'); diff --git a/test/build_test_oql.php b/test/php-unit-tests/legacy-tests/build_test_oql.php similarity index 98% rename from test/build_test_oql.php rename to test/php-unit-tests/legacy-tests/build_test_oql.php index 417e2b9a5..109598ab1 100644 --- a/test/build_test_oql.php +++ b/test/php-unit-tests/legacy-tests/build_test_oql.php @@ -22,7 +22,7 @@ */ -require_once('../approot.inc.php'); +require_once('../../../approot.inc.php'); require_once(APPROOT.'application/startup.inc.php'); \LoginWebPage::DoLogin(true); diff --git a/test/config-test-farm.php b/test/php-unit-tests/legacy-tests/config-test-farm.php similarity index 100% rename from test/config-test-farm.php rename to test/php-unit-tests/legacy-tests/config-test-farm.php diff --git a/test/display_cache_content.php b/test/php-unit-tests/legacy-tests/display_cache_content.php similarity index 98% rename from test/display_cache_content.php rename to test/php-unit-tests/legacy-tests/display_cache_content.php index 6a22a85c6..2eaac1aaa 100644 --- a/test/display_cache_content.php +++ b/test/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/test/php-unit-tests/legacy-tests/replay_query_log.php similarity index 99% rename from test/replay_query_log.php rename to test/php-unit-tests/legacy-tests/replay_query_log.php index fed149b0c..0a25dac65 100644 --- a/test/replay_query_log.php +++ b/test/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/test/php-unit-tests/legacy-tests/test.class.inc.php similarity index 100% rename from test/test.class.inc.php rename to test/php-unit-tests/legacy-tests/test.class.inc.php diff --git a/test/test.php b/test/php-unit-tests/legacy-tests/test.php similarity index 98% rename from test/test.php rename to test/php-unit-tests/legacy-tests/test.php index 1db1c24e4..26a9aae1b 100644 --- a/test/test.php +++ b/test/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/test/php-unit-tests/legacy-tests/testlist.inc.php similarity index 100% rename from test/testlist.inc.php rename to test/php-unit-tests/legacy-tests/testlist.inc.php From e8bf9cf6881d6d45dcce2668aceab2bfdfe0460a Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 21:08:59 +0200 Subject: [PATCH 07/31] =?UTF-8?q?N=C2=B05608=20-=20Move=20"twig"=20PHP=20u?= =?UTF-8?q?nit=20test=20to=20new=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notice: Test was not working, still not working --- .../tests/sources/application/TwigBase/Twig}/TwigTest.php | 0 .../tests/sources/application/TwigBase/Twig}/attacker/backdoor | 0 .../tests/sources/application/TwigBase/Twig}/test.html | 0 .../tests/sources/application/TwigBase/Twig}/test.html.twig | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/{twig => php-unit-tests/tests/sources/application/TwigBase/Twig}/TwigTest.php (100%) rename test/{twig => php-unit-tests/tests/sources/application/TwigBase/Twig}/attacker/backdoor (100%) rename test/{twig => php-unit-tests/tests/sources/application/TwigBase/Twig}/test.html (100%) rename test/{twig => php-unit-tests/tests/sources/application/TwigBase/Twig}/test.html.twig (100%) diff --git a/test/twig/TwigTest.php b/test/php-unit-tests/tests/sources/application/TwigBase/Twig/TwigTest.php similarity index 100% rename from test/twig/TwigTest.php rename to test/php-unit-tests/tests/sources/application/TwigBase/Twig/TwigTest.php diff --git a/test/twig/attacker/backdoor b/test/php-unit-tests/tests/sources/application/TwigBase/Twig/attacker/backdoor similarity index 100% rename from test/twig/attacker/backdoor rename to test/php-unit-tests/tests/sources/application/TwigBase/Twig/attacker/backdoor diff --git a/test/twig/test.html b/test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html similarity index 100% rename from test/twig/test.html rename to test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html diff --git a/test/twig/test.html.twig b/test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html.twig similarity index 100% rename from test/twig/test.html.twig rename to test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html.twig From 471f66649a90a45ad6920562fce950f1e4ee5a0f Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 21:44:29 +0200 Subject: [PATCH 08/31] =?UTF-8?q?N=C2=B05608=20-=20Rename=20unitary=20test?= =?UTF-8?q?=20folders=20for=20better=20understanding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DictionariesConsistencyTest.php | 0 .../iTopModulesPhpVersionChecklistTest.php | 0 .../iTopModulesXmlVersionChecklistTest.php | 0 test/php-unit-tests/phpunit.xml.dist | 18 +++++++++--------- .../SetupCssIntegrityChecklistTest.php | 0 .../iTopDesignFormatChecklistTest.php | 0 .../iTopModuleXmlInstallationChecklistTest.php | 0 .../postbuild_integration.xml.dist | 2 +- .../application/DashboardLayoutTest.php | 0 .../application/UtilsTest.php | 0 .../application/composer/iTopComposerTest.php | 0 .../application/privUITransactionFileTest.php | 0 .../search/CriterionConversionTest.php | 0 .../application/search/CriterionParserTest.php | 0 .../application/search/SearchFormTest.php | 0 .../core/BulkChangeTest.inc.php | 0 .../core/CMDBObjectTest.php | 0 .../core/CMDBSource/CMDBSourceTest.php | 0 .../core/CMDBSource/DeadLockInjection.php | 0 .../core/CMDBSource/TransactionsTest.php | 0 .../core/ConfigPlaceholdersResolverTest.php | 0 .../core/ConfigTest.php | 0 .../core/ConfigTest/config-itop-joker.php | 0 .../core/ConfigTest/config-itop-var.php | 0 .../config-itop_KO_config_plus_code.php | 0 .../config-itop_KO_function.php | 0 .../core/ConfigValidator/config-itop_VALID.php | 0 .../config-itop_VALID_log-level-min_const.php | 0 .../iTopConfigAstValidatorTest.php | 0 .../core/DBObjectTest.php | 0 .../core/DBSearchCommitTest.php | 0 .../core/DBSearchIntersectTest.php | 0 .../core/DBSearchJoinTest.php | 0 .../core/DBSearchTest.php | 0 .../core/DBSearchUpdateRealiasingMapTest.php | 0 .../core/ExpressionTest.php | 0 .../core/LogAPITest.php | 0 .../core/LogFileNameBuilderTest.php | 0 .../core/MetaModelTest.php | 0 .../core/OQLParserTest.php | 0 .../{tests => unitary-tests}/core/OQLTest.php | 0 .../core/TagSetFieldDataTest.php | 0 .../core/TriggerTest.php | 0 .../core/UniquenessConstraintTest.php | 0 .../core/UserRightsTest.php | 0 .../core/WeeklyScheduledProcessMockConfig.php | 0 .../core/WeeklyScheduledProcessTest.php | 0 .../core/apcEmulationTest.php | 0 .../core/dictApcuTest.php | 0 .../{tests => unitary-tests}/core/dictTest.php | 0 .../core/iTopConfigParserTest.php | 0 .../core/mockApcEmulation.incphp | 0 .../core/mockDict.incphp | 0 .../core/ormLinkSetTest.php | 0 .../core/ormTagSetTest.php | 0 .../sanitizer/AbstractDOMSanitizerTest.php | 0 .../core/sanitizer/HTMLDOMSanitizerTest.php | 0 .../core/sanitizer/InlineImageMock.php | 0 .../core/sanitizer/README.txt | 0 .../core/sanitizer/SvgDOMSanitizerTest.php | 0 .../core/sanitizer/input/scripts.html | 0 .../core/sanitizer/input/scripts.svg | 0 .../utf-8_wrong_character_email_truncated.txt | 0 .../core/sanitizer/input/whitelist_test.html | 0 .../core/sanitizer/output/scripts.html | 0 .../core/sanitizer/output/scripts.svg | 0 .../utf-8_wrong_character_email_truncated.txt | 0 .../2.x/authent-local/UserLocalTest.php | 0 .../UserLocalPasswordPolicyMock.php | 0 .../Validator/iTopConfigAstValidatorTest.php | 0 .../iTopConfigSyntaxValidatorTest.php | 0 .../2.x/itop-tickets/itopTicketTest.php | 0 .../setup/DBBackupTest.php | 0 .../setup/SetupUtilsTest.php | 0 .../iTopDesignFormat/1.7_to_1.6.expected.xml | 0 .../iTopDesignFormat/1.7_to_1.6.input.xml | 0 .../iTopDesignFormat/iTopDesignFormatTest.php | 0 .../application/TwigBase/Twig/TwigTest.php | 0 .../TwigBase/Twig/attacker/backdoor | 0 .../application/TwigBase/Twig/test.html | 0 .../application/TwigBase/Twig/test.html.twig | 0 .../status/StatusIncTest.php | 0 .../status/StatusTest.php | 0 .../{tests => unitary-tests}/status/status.php | 0 .../webservices/RestTest.php | 0 85 files changed, 10 insertions(+), 10 deletions(-) rename test/php-unit-tests/{integration => integration-tests}/DictionariesConsistencyTest.php (100%) rename test/php-unit-tests/{integration => integration-tests}/iTopModulesPhpVersionChecklistTest.php (100%) rename test/php-unit-tests/{integration => integration-tests}/iTopModulesXmlVersionChecklistTest.php (100%) rename test/php-unit-tests/{postbuild_integration => post-build-integration-tests}/SetupCssIntegrityChecklistTest.php (100%) rename test/php-unit-tests/{postbuild_integration => post-build-integration-tests}/iTopDesignFormatChecklistTest.php (100%) rename test/php-unit-tests/{postbuild_integration => post-build-integration-tests}/iTopModuleXmlInstallationChecklistTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/DashboardLayoutTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/UtilsTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/composer/iTopComposerTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/privUITransactionFileTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/search/CriterionConversionTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/search/CriterionParserTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/application/search/SearchFormTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/BulkChangeTest.inc.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/CMDBObjectTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/CMDBSource/CMDBSourceTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/CMDBSource/DeadLockInjection.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/CMDBSource/TransactionsTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigPlaceholdersResolverTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigTest/config-itop-joker.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigTest/config-itop-var.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigValidator/config-itop_KO_config_plus_code.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigValidator/config-itop_KO_function.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigValidator/config-itop_VALID.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigValidator/config-itop_VALID_log-level-min_const.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ConfigValidator/iTopConfigAstValidatorTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBObjectTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBSearchCommitTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBSearchIntersectTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBSearchJoinTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBSearchTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/DBSearchUpdateRealiasingMapTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ExpressionTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/LogAPITest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/LogFileNameBuilderTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/MetaModelTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/OQLParserTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/OQLTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/TagSetFieldDataTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/TriggerTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/UniquenessConstraintTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/UserRightsTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/WeeklyScheduledProcessMockConfig.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/WeeklyScheduledProcessTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/apcEmulationTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/dictApcuTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/dictTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/iTopConfigParserTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/mockApcEmulation.incphp (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/mockDict.incphp (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ormLinkSetTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/ormTagSetTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/AbstractDOMSanitizerTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/HTMLDOMSanitizerTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/InlineImageMock.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/README.txt (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/SvgDOMSanitizerTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/input/scripts.html (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/input/scripts.svg (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/input/whitelist_test.html (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/output/scripts.html (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/output/scripts.svg (100%) rename test/php-unit-tests/{tests => unitary-tests}/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt (100%) rename test/php-unit-tests/{tests => unitary-tests}/datamodels/2.x/authent-local/UserLocalTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/datamodels/2.x/itop-tickets/itopTicketTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/setup/DBBackupTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/setup/SetupUtilsTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/setup/iTopDesignFormat/1.7_to_1.6.expected.xml (100%) rename test/php-unit-tests/{tests => unitary-tests}/setup/iTopDesignFormat/1.7_to_1.6.input.xml (100%) rename test/php-unit-tests/{tests => unitary-tests}/setup/iTopDesignFormat/iTopDesignFormatTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/sources/application/TwigBase/Twig/TwigTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/sources/application/TwigBase/Twig/attacker/backdoor (100%) rename test/php-unit-tests/{tests => unitary-tests}/sources/application/TwigBase/Twig/test.html (100%) rename test/php-unit-tests/{tests => unitary-tests}/sources/application/TwigBase/Twig/test.html.twig (100%) rename test/php-unit-tests/{tests => unitary-tests}/status/StatusIncTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/status/StatusTest.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/status/status.php (100%) rename test/php-unit-tests/{tests => unitary-tests}/webservices/RestTest.php (100%) diff --git a/test/php-unit-tests/integration/DictionariesConsistencyTest.php b/test/php-unit-tests/integration-tests/DictionariesConsistencyTest.php similarity index 100% rename from test/php-unit-tests/integration/DictionariesConsistencyTest.php rename to test/php-unit-tests/integration-tests/DictionariesConsistencyTest.php diff --git a/test/php-unit-tests/integration/iTopModulesPhpVersionChecklistTest.php b/test/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php similarity index 100% rename from test/php-unit-tests/integration/iTopModulesPhpVersionChecklistTest.php rename to test/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php diff --git a/test/php-unit-tests/integration/iTopModulesXmlVersionChecklistTest.php b/test/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php similarity index 100% rename from test/php-unit-tests/integration/iTopModulesXmlVersionChecklistTest.php rename to test/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php diff --git a/test/php-unit-tests/phpunit.xml.dist b/test/php-unit-tests/phpunit.xml.dist index 6bc9513a3..ea11c8160 100644 --- a/test/php-unit-tests/phpunit.xml.dist +++ b/test/php-unit-tests/phpunit.xml.dist @@ -29,32 +29,32 @@ - tests/application + unitary-tests/application - tests/core + unitary-tests/core - tests/datamodels/2.x/authent-local + unitary-tests/datamodels/2.x/authent-local - integration + integration-tests - tests/datamodels/2.x/itop-config + unitary-tests/datamodels/2.x/itop-config - tests/datamodels/2.x/itop-tickets + unitary-tests/datamodels/2.x/itop-tickets - tests/setup + unitary-tests/setup - tests/status + unitary-tests/status - tests/webservices + unitary-tests/webservices diff --git a/test/php-unit-tests/postbuild_integration/SetupCssIntegrityChecklistTest.php b/test/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php similarity index 100% rename from test/php-unit-tests/postbuild_integration/SetupCssIntegrityChecklistTest.php rename to test/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php diff --git a/test/php-unit-tests/postbuild_integration/iTopDesignFormatChecklistTest.php b/test/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php similarity index 100% rename from test/php-unit-tests/postbuild_integration/iTopDesignFormatChecklistTest.php rename to test/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php diff --git a/test/php-unit-tests/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php b/test/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php similarity index 100% rename from test/php-unit-tests/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php rename to test/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php diff --git a/test/php-unit-tests/postbuild_integration.xml.dist b/test/php-unit-tests/postbuild_integration.xml.dist index 2032e204e..b45e634bb 100644 --- a/test/php-unit-tests/postbuild_integration.xml.dist +++ b/test/php-unit-tests/postbuild_integration.xml.dist @@ -27,7 +27,7 @@ - postbuild_integration + post-build-integration-tests diff --git a/test/php-unit-tests/tests/application/DashboardLayoutTest.php b/test/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php similarity index 100% rename from test/php-unit-tests/tests/application/DashboardLayoutTest.php rename to test/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php diff --git a/test/php-unit-tests/tests/application/UtilsTest.php b/test/php-unit-tests/unitary-tests/application/UtilsTest.php similarity index 100% rename from test/php-unit-tests/tests/application/UtilsTest.php rename to test/php-unit-tests/unitary-tests/application/UtilsTest.php diff --git a/test/php-unit-tests/tests/application/composer/iTopComposerTest.php b/test/php-unit-tests/unitary-tests/application/composer/iTopComposerTest.php similarity index 100% rename from test/php-unit-tests/tests/application/composer/iTopComposerTest.php rename to test/php-unit-tests/unitary-tests/application/composer/iTopComposerTest.php diff --git a/test/php-unit-tests/tests/application/privUITransactionFileTest.php b/test/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php similarity index 100% rename from test/php-unit-tests/tests/application/privUITransactionFileTest.php rename to test/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php diff --git a/test/php-unit-tests/tests/application/search/CriterionConversionTest.php b/test/php-unit-tests/unitary-tests/application/search/CriterionConversionTest.php similarity index 100% rename from test/php-unit-tests/tests/application/search/CriterionConversionTest.php rename to test/php-unit-tests/unitary-tests/application/search/CriterionConversionTest.php diff --git a/test/php-unit-tests/tests/application/search/CriterionParserTest.php b/test/php-unit-tests/unitary-tests/application/search/CriterionParserTest.php similarity index 100% rename from test/php-unit-tests/tests/application/search/CriterionParserTest.php rename to test/php-unit-tests/unitary-tests/application/search/CriterionParserTest.php diff --git a/test/php-unit-tests/tests/application/search/SearchFormTest.php b/test/php-unit-tests/unitary-tests/application/search/SearchFormTest.php similarity index 100% rename from test/php-unit-tests/tests/application/search/SearchFormTest.php rename to test/php-unit-tests/unitary-tests/application/search/SearchFormTest.php diff --git a/test/php-unit-tests/tests/core/BulkChangeTest.inc.php b/test/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php similarity index 100% rename from test/php-unit-tests/tests/core/BulkChangeTest.inc.php rename to test/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php diff --git a/test/php-unit-tests/tests/core/CMDBObjectTest.php b/test/php-unit-tests/unitary-tests/core/CMDBObjectTest.php similarity index 100% rename from test/php-unit-tests/tests/core/CMDBObjectTest.php rename to test/php-unit-tests/unitary-tests/core/CMDBObjectTest.php diff --git a/test/php-unit-tests/tests/core/CMDBSource/CMDBSourceTest.php b/test/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php similarity index 100% rename from test/php-unit-tests/tests/core/CMDBSource/CMDBSourceTest.php rename to test/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php diff --git a/test/php-unit-tests/tests/core/CMDBSource/DeadLockInjection.php b/test/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php similarity index 100% rename from test/php-unit-tests/tests/core/CMDBSource/DeadLockInjection.php rename to test/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php diff --git a/test/php-unit-tests/tests/core/CMDBSource/TransactionsTest.php b/test/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php similarity index 100% rename from test/php-unit-tests/tests/core/CMDBSource/TransactionsTest.php rename to test/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php diff --git a/test/php-unit-tests/tests/core/ConfigPlaceholdersResolverTest.php b/test/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigPlaceholdersResolverTest.php rename to test/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php diff --git a/test/php-unit-tests/tests/core/ConfigTest.php b/test/php-unit-tests/unitary-tests/core/ConfigTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigTest.php rename to test/php-unit-tests/unitary-tests/core/ConfigTest.php diff --git a/test/php-unit-tests/tests/core/ConfigTest/config-itop-joker.php b/test/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigTest/config-itop-joker.php rename to test/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php diff --git a/test/php-unit-tests/tests/core/ConfigTest/config-itop-var.php b/test/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigTest/config-itop-var.php rename to test/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php diff --git a/test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_config_plus_code.php b/test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_config_plus_code.php rename to test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php diff --git a/test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_function.php b/test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigValidator/config-itop_KO_function.php rename to test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php diff --git a/test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID.php b/test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID.php rename to test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php diff --git a/test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php b/test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php rename to test/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php diff --git a/test/php-unit-tests/tests/core/ConfigValidator/iTopConfigAstValidatorTest.php b/test/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ConfigValidator/iTopConfigAstValidatorTest.php rename to test/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php diff --git a/test/php-unit-tests/tests/core/DBObjectTest.php b/test/php-unit-tests/unitary-tests/core/DBObjectTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBObjectTest.php rename to test/php-unit-tests/unitary-tests/core/DBObjectTest.php diff --git a/test/php-unit-tests/tests/core/DBSearchCommitTest.php b/test/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBSearchCommitTest.php rename to test/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php diff --git a/test/php-unit-tests/tests/core/DBSearchIntersectTest.php b/test/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBSearchIntersectTest.php rename to test/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php diff --git a/test/php-unit-tests/tests/core/DBSearchJoinTest.php b/test/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBSearchJoinTest.php rename to test/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php diff --git a/test/php-unit-tests/tests/core/DBSearchTest.php b/test/php-unit-tests/unitary-tests/core/DBSearchTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBSearchTest.php rename to test/php-unit-tests/unitary-tests/core/DBSearchTest.php diff --git a/test/php-unit-tests/tests/core/DBSearchUpdateRealiasingMapTest.php b/test/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php similarity index 100% rename from test/php-unit-tests/tests/core/DBSearchUpdateRealiasingMapTest.php rename to test/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php diff --git a/test/php-unit-tests/tests/core/ExpressionTest.php b/test/php-unit-tests/unitary-tests/core/ExpressionTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ExpressionTest.php rename to test/php-unit-tests/unitary-tests/core/ExpressionTest.php diff --git a/test/php-unit-tests/tests/core/LogAPITest.php b/test/php-unit-tests/unitary-tests/core/LogAPITest.php similarity index 100% rename from test/php-unit-tests/tests/core/LogAPITest.php rename to test/php-unit-tests/unitary-tests/core/LogAPITest.php diff --git a/test/php-unit-tests/tests/core/LogFileNameBuilderTest.php b/test/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php similarity index 100% rename from test/php-unit-tests/tests/core/LogFileNameBuilderTest.php rename to test/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php diff --git a/test/php-unit-tests/tests/core/MetaModelTest.php b/test/php-unit-tests/unitary-tests/core/MetaModelTest.php similarity index 100% rename from test/php-unit-tests/tests/core/MetaModelTest.php rename to test/php-unit-tests/unitary-tests/core/MetaModelTest.php diff --git a/test/php-unit-tests/tests/core/OQLParserTest.php b/test/php-unit-tests/unitary-tests/core/OQLParserTest.php similarity index 100% rename from test/php-unit-tests/tests/core/OQLParserTest.php rename to test/php-unit-tests/unitary-tests/core/OQLParserTest.php diff --git a/test/php-unit-tests/tests/core/OQLTest.php b/test/php-unit-tests/unitary-tests/core/OQLTest.php similarity index 100% rename from test/php-unit-tests/tests/core/OQLTest.php rename to test/php-unit-tests/unitary-tests/core/OQLTest.php diff --git a/test/php-unit-tests/tests/core/TagSetFieldDataTest.php b/test/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php similarity index 100% rename from test/php-unit-tests/tests/core/TagSetFieldDataTest.php rename to test/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php diff --git a/test/php-unit-tests/tests/core/TriggerTest.php b/test/php-unit-tests/unitary-tests/core/TriggerTest.php similarity index 100% rename from test/php-unit-tests/tests/core/TriggerTest.php rename to test/php-unit-tests/unitary-tests/core/TriggerTest.php diff --git a/test/php-unit-tests/tests/core/UniquenessConstraintTest.php b/test/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php similarity index 100% rename from test/php-unit-tests/tests/core/UniquenessConstraintTest.php rename to test/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php diff --git a/test/php-unit-tests/tests/core/UserRightsTest.php b/test/php-unit-tests/unitary-tests/core/UserRightsTest.php similarity index 100% rename from test/php-unit-tests/tests/core/UserRightsTest.php rename to test/php-unit-tests/unitary-tests/core/UserRightsTest.php diff --git a/test/php-unit-tests/tests/core/WeeklyScheduledProcessMockConfig.php b/test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php similarity index 100% rename from test/php-unit-tests/tests/core/WeeklyScheduledProcessMockConfig.php rename to test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php diff --git a/test/php-unit-tests/tests/core/WeeklyScheduledProcessTest.php b/test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php similarity index 100% rename from test/php-unit-tests/tests/core/WeeklyScheduledProcessTest.php rename to test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php diff --git a/test/php-unit-tests/tests/core/apcEmulationTest.php b/test/php-unit-tests/unitary-tests/core/apcEmulationTest.php similarity index 100% rename from test/php-unit-tests/tests/core/apcEmulationTest.php rename to test/php-unit-tests/unitary-tests/core/apcEmulationTest.php diff --git a/test/php-unit-tests/tests/core/dictApcuTest.php b/test/php-unit-tests/unitary-tests/core/dictApcuTest.php similarity index 100% rename from test/php-unit-tests/tests/core/dictApcuTest.php rename to test/php-unit-tests/unitary-tests/core/dictApcuTest.php diff --git a/test/php-unit-tests/tests/core/dictTest.php b/test/php-unit-tests/unitary-tests/core/dictTest.php similarity index 100% rename from test/php-unit-tests/tests/core/dictTest.php rename to test/php-unit-tests/unitary-tests/core/dictTest.php diff --git a/test/php-unit-tests/tests/core/iTopConfigParserTest.php b/test/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php similarity index 100% rename from test/php-unit-tests/tests/core/iTopConfigParserTest.php rename to test/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php diff --git a/test/php-unit-tests/tests/core/mockApcEmulation.incphp b/test/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp similarity index 100% rename from test/php-unit-tests/tests/core/mockApcEmulation.incphp rename to test/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp diff --git a/test/php-unit-tests/tests/core/mockDict.incphp b/test/php-unit-tests/unitary-tests/core/mockDict.incphp similarity index 100% rename from test/php-unit-tests/tests/core/mockDict.incphp rename to test/php-unit-tests/unitary-tests/core/mockDict.incphp diff --git a/test/php-unit-tests/tests/core/ormLinkSetTest.php b/test/php-unit-tests/unitary-tests/core/ormLinkSetTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ormLinkSetTest.php rename to test/php-unit-tests/unitary-tests/core/ormLinkSetTest.php diff --git a/test/php-unit-tests/tests/core/ormTagSetTest.php b/test/php-unit-tests/unitary-tests/core/ormTagSetTest.php similarity index 100% rename from test/php-unit-tests/tests/core/ormTagSetTest.php rename to test/php-unit-tests/unitary-tests/core/ormTagSetTest.php diff --git a/test/php-unit-tests/tests/core/sanitizer/AbstractDOMSanitizerTest.php b/test/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/AbstractDOMSanitizerTest.php rename to test/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php diff --git a/test/php-unit-tests/tests/core/sanitizer/HTMLDOMSanitizerTest.php b/test/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/HTMLDOMSanitizerTest.php rename to test/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php diff --git a/test/php-unit-tests/tests/core/sanitizer/InlineImageMock.php b/test/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/InlineImageMock.php rename to test/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php diff --git a/test/php-unit-tests/tests/core/sanitizer/README.txt b/test/php-unit-tests/unitary-tests/core/sanitizer/README.txt similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/README.txt rename to test/php-unit-tests/unitary-tests/core/sanitizer/README.txt diff --git a/test/php-unit-tests/tests/core/sanitizer/SvgDOMSanitizerTest.php b/test/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/SvgDOMSanitizerTest.php rename to test/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php diff --git a/test/php-unit-tests/tests/core/sanitizer/input/scripts.html b/test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/input/scripts.html rename to test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html diff --git a/test/php-unit-tests/tests/core/sanitizer/input/scripts.svg b/test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/input/scripts.svg rename to test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg diff --git a/test/php-unit-tests/tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt b/test/php-unit-tests/unitary-tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt rename to test/php-unit-tests/unitary-tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt diff --git a/test/php-unit-tests/tests/core/sanitizer/input/whitelist_test.html b/test/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/input/whitelist_test.html rename to test/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html diff --git a/test/php-unit-tests/tests/core/sanitizer/output/scripts.html b/test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/output/scripts.html rename to test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html diff --git a/test/php-unit-tests/tests/core/sanitizer/output/scripts.svg b/test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/output/scripts.svg rename to test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg diff --git a/test/php-unit-tests/tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt b/test/php-unit-tests/unitary-tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt similarity index 100% rename from test/php-unit-tests/tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt rename to test/php-unit-tests/unitary-tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt diff --git a/test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest.php b/test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php similarity index 100% rename from test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest.php rename to test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php diff --git a/test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php b/test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php similarity index 100% rename from test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php rename to test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php diff --git a/test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php b/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php rename to test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php diff --git a/test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php similarity index 100% rename from test/php-unit-tests/tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php rename to test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php diff --git a/test/php-unit-tests/tests/datamodels/2.x/itop-tickets/itopTicketTest.php b/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php similarity index 100% rename from test/php-unit-tests/tests/datamodels/2.x/itop-tickets/itopTicketTest.php rename to test/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php diff --git a/test/php-unit-tests/tests/setup/DBBackupTest.php b/test/php-unit-tests/unitary-tests/setup/DBBackupTest.php similarity index 100% rename from test/php-unit-tests/tests/setup/DBBackupTest.php rename to test/php-unit-tests/unitary-tests/setup/DBBackupTest.php diff --git a/test/php-unit-tests/tests/setup/SetupUtilsTest.php b/test/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php similarity index 100% rename from test/php-unit-tests/tests/setup/SetupUtilsTest.php rename to test/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php diff --git a/test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml b/test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml similarity index 100% rename from test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml rename to test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml diff --git a/test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml b/test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml similarity index 100% rename from test/php-unit-tests/tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml rename to test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml diff --git a/test/php-unit-tests/tests/setup/iTopDesignFormat/iTopDesignFormatTest.php b/test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php similarity index 100% rename from test/php-unit-tests/tests/setup/iTopDesignFormat/iTopDesignFormatTest.php rename to test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php diff --git a/test/php-unit-tests/tests/sources/application/TwigBase/Twig/TwigTest.php b/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php similarity index 100% rename from test/php-unit-tests/tests/sources/application/TwigBase/Twig/TwigTest.php rename to test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php diff --git a/test/php-unit-tests/tests/sources/application/TwigBase/Twig/attacker/backdoor b/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor similarity index 100% rename from test/php-unit-tests/tests/sources/application/TwigBase/Twig/attacker/backdoor rename to test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor diff --git a/test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html b/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html similarity index 100% rename from test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html rename to test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html diff --git a/test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html.twig b/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig similarity index 100% rename from test/php-unit-tests/tests/sources/application/TwigBase/Twig/test.html.twig rename to test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig diff --git a/test/php-unit-tests/tests/status/StatusIncTest.php b/test/php-unit-tests/unitary-tests/status/StatusIncTest.php similarity index 100% rename from test/php-unit-tests/tests/status/StatusIncTest.php rename to test/php-unit-tests/unitary-tests/status/StatusIncTest.php diff --git a/test/php-unit-tests/tests/status/StatusTest.php b/test/php-unit-tests/unitary-tests/status/StatusTest.php similarity index 100% rename from test/php-unit-tests/tests/status/StatusTest.php rename to test/php-unit-tests/unitary-tests/status/StatusTest.php diff --git a/test/php-unit-tests/tests/status/status.php b/test/php-unit-tests/unitary-tests/status/status.php similarity index 100% rename from test/php-unit-tests/tests/status/status.php rename to test/php-unit-tests/unitary-tests/status/status.php diff --git a/test/php-unit-tests/tests/webservices/RestTest.php b/test/php-unit-tests/unitary-tests/webservices/RestTest.php similarity index 100% rename from test/php-unit-tests/tests/webservices/RestTest.php rename to test/php-unit-tests/unitary-tests/webservices/RestTest.php From 0998c73a1a94c08486ff6d6bca58b841461647f1 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 21:57:41 +0200 Subject: [PATCH 09/31] =?UTF-8?q?N=C2=B05608=20-=20Add=20README=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/php-unit-tests/README.md | 6 ++++++ test/php-unit-tests/legacy-tests/README.md | 1 + 2 files changed, 7 insertions(+) create mode 100644 test/php-unit-tests/README.md create mode 100644 test/php-unit-tests/legacy-tests/README.md diff --git a/test/php-unit-tests/README.md b/test/php-unit-tests/README.md new file mode 100644 index 000000000..04d26c928 --- /dev/null +++ b/test/php-unit-tests/README.md @@ -0,0 +1,6 @@ +# Where should I add my test? + +- Covers an iTop PHP class or method? + - Most likely in "unitary-tests". +- Covers the consistency of some data through the app? + - Most likely in "integration-tests". \ No newline at end of file diff --git a/test/php-unit-tests/legacy-tests/README.md b/test/php-unit-tests/legacy-tests/README.md new file mode 100644 index 000000000..08c576281 --- /dev/null +++ b/test/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 From 11d8547cefd3160dec3ba66b4795043f19102749 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 13 Oct 2022 22:12:14 +0200 Subject: [PATCH 10/31] =?UTF-8?q?N=C2=B05608=20-=20Move/rename=20unit=20te?= =?UTF-8?q?sts=20to=20match=20their=20counterpart=20location/name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/php-unit-tests/phpunit.xml.dist | 7 +++++++ .../application/{UtilsTest.php => utilsTest.php} | 2 +- .../composer => sources/Composer}/iTopComposerTest.php | 9 +++------ .../application/search/CriterionConversionTest.php | 0 .../application/search/CriterionParserTest.php | 0 .../{ => sources}/application/search/SearchFormTest.php | 0 6 files changed, 11 insertions(+), 7 deletions(-) rename test/php-unit-tests/unitary-tests/application/{UtilsTest.php => utilsTest.php} (99%) rename test/php-unit-tests/unitary-tests/{application/composer => sources/Composer}/iTopComposerTest.php (94%) rename test/php-unit-tests/unitary-tests/{ => sources}/application/search/CriterionConversionTest.php (100%) rename test/php-unit-tests/unitary-tests/{ => sources}/application/search/CriterionParserTest.php (100%) rename test/php-unit-tests/unitary-tests/{ => sources}/application/search/SearchFormTest.php (100%) diff --git a/test/php-unit-tests/phpunit.xml.dist b/test/php-unit-tests/phpunit.xml.dist index ea11c8160..099fb9406 100644 --- a/test/php-unit-tests/phpunit.xml.dist +++ b/test/php-unit-tests/phpunit.xml.dist @@ -50,6 +50,13 @@ unitary-tests/setup + + + unitary-tests/sources/application/search + + + unitary-tests/sources/Composer + unitary-tests/status diff --git a/test/php-unit-tests/unitary-tests/application/UtilsTest.php b/test/php-unit-tests/unitary-tests/application/utilsTest.php similarity index 99% rename from test/php-unit-tests/unitary-tests/application/UtilsTest.php rename to test/php-unit-tests/unitary-tests/application/utilsTest.php index e09b7d25c..354146b7c 100644 --- a/test/php-unit-tests/unitary-tests/application/UtilsTest.php +++ b/test/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/php-unit-tests/unitary-tests/application/composer/iTopComposerTest.php b/test/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php similarity index 94% rename from test/php-unit-tests/unitary-tests/application/composer/iTopComposerTest.php rename to test/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php index e103360aa..6fe8e08e5 100644 --- a/test/php-unit-tests/unitary-tests/application/composer/iTopComposerTest.php +++ b/test/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/php-unit-tests/unitary-tests/application/search/CriterionConversionTest.php b/test/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/search/CriterionConversionTest.php rename to test/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php diff --git a/test/php-unit-tests/unitary-tests/application/search/CriterionParserTest.php b/test/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/search/CriterionParserTest.php rename to test/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php diff --git a/test/php-unit-tests/unitary-tests/application/search/SearchFormTest.php b/test/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/search/SearchFormTest.php rename to test/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php From 87cb73c038f97a19859ac92d67292d1dec487734 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 14 Oct 2022 15:38:56 +0200 Subject: [PATCH 11/31] =?UTF-8?q?N=C2=B05608=20-=20Rename=20"test"=20folde?= =?UTF-8?q?r=20to=20"tests"=20to=20better=20match=20conventions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- test/ci_description.ini | 8 -------- {test => tests}/backups/backup-itop.tar.gz | Bin tests/ci_description.ini | 8 ++++++++ .../attributeset_widget_poc.html | 0 .../manual-visual-tests/sanitize_test.php | 0 {test => tests}/php-unit-tests/ItopDataTestCase.php | 0 {test => tests}/php-unit-tests/ItopTestCase.php | 0 {test => tests}/php-unit-tests/README.md | 0 {test => tests}/php-unit-tests/composer.json | 0 .../DictionariesConsistencyTest.php | 0 .../iTopModulesPhpVersionChecklistTest.php | 0 .../iTopModulesXmlVersionChecklistTest.php | 0 .../legacy-tests/GroupByAndFunctions.php | 2 +- .../php-unit-tests/legacy-tests/README.md | 0 .../php-unit-tests/legacy-tests/VerifyOQL.php | 0 .../php-unit-tests/legacy-tests/benchmark.php | 0 .../php-unit-tests/legacy-tests/build_test_oql.php | 4 ++-- .../legacy-tests/config-test-farm.php | 0 .../legacy-tests/display_cache_content.php | 0 .../legacy-tests/replay_query_log.php | 0 .../php-unit-tests/legacy-tests/test.class.inc.php | 0 .../php-unit-tests/legacy-tests/test.php | 0 .../php-unit-tests/legacy-tests/testlist.inc.php | 0 {test => tests}/php-unit-tests/phpunit.xml.dist | 0 .../SetupCssIntegrityChecklistTest.php | 0 .../iTopDesignFormatChecklistTest.php | 0 .../iTopModuleXmlInstallationChecklistTest.php | 0 .../php-unit-tests/postbuild_integration.xml.dist | 0 .../application/DashboardLayoutTest.php | 0 .../application/privUITransactionFileTest.php | 0 .../unitary-tests/application/utilsTest.php | 0 .../unitary-tests/core/BulkChangeTest.inc.php | 0 .../unitary-tests/core/CMDBObjectTest.php | 0 .../core/CMDBSource/CMDBSourceTest.php | 0 .../core/CMDBSource/DeadLockInjection.php | 0 .../core/CMDBSource/TransactionsTest.php | 0 .../core/ConfigPlaceholdersResolverTest.php | 0 .../unitary-tests/core/ConfigTest.php | 0 .../core/ConfigTest/config-itop-joker.php | 0 .../core/ConfigTest/config-itop-var.php | 0 .../config-itop_KO_config_plus_code.php | 0 .../ConfigValidator/config-itop_KO_function.php | 0 .../core/ConfigValidator/config-itop_VALID.php | 0 .../config-itop_VALID_log-level-min_const.php | 0 .../ConfigValidator/iTopConfigAstValidatorTest.php | 0 .../unitary-tests/core/DBObjectTest.php | 0 .../unitary-tests/core/DBSearchCommitTest.php | 0 .../unitary-tests/core/DBSearchIntersectTest.php | 0 .../unitary-tests/core/DBSearchJoinTest.php | 0 .../unitary-tests/core/DBSearchTest.php | 0 .../core/DBSearchUpdateRealiasingMapTest.php | 0 .../unitary-tests/core/ExpressionTest.php | 0 .../unitary-tests/core/LogAPITest.php | 0 .../unitary-tests/core/LogFileNameBuilderTest.php | 0 .../unitary-tests/core/MetaModelTest.php | 0 .../unitary-tests/core/OQLParserTest.php | 0 .../php-unit-tests/unitary-tests/core/OQLTest.php | 0 .../unitary-tests/core/TagSetFieldDataTest.php | 0 .../unitary-tests/core/TriggerTest.php | 0 .../unitary-tests/core/UniquenessConstraintTest.php | 0 .../unitary-tests/core/UserRightsTest.php | 0 .../core/WeeklyScheduledProcessMockConfig.php | 0 .../core/WeeklyScheduledProcessTest.php | 2 +- .../unitary-tests/core/apcEmulationTest.php | 0 .../unitary-tests/core/dictApcuTest.php | 0 .../php-unit-tests/unitary-tests/core/dictTest.php | 0 .../unitary-tests/core/iTopConfigParserTest.php | 0 .../unitary-tests/core/mockApcEmulation.incphp | 0 .../unitary-tests/core/mockDict.incphp | 0 .../unitary-tests/core/ormLinkSetTest.php | 0 .../unitary-tests/core/ormTagSetTest.php | 0 .../core/sanitizer/AbstractDOMSanitizerTest.php | 0 .../core/sanitizer/HTMLDOMSanitizerTest.php | 2 +- .../core/sanitizer/InlineImageMock.php | 0 .../unitary-tests/core/sanitizer/README.txt | 0 .../core/sanitizer/SvgDOMSanitizerTest.php | 0 .../unitary-tests/core/sanitizer/input/scripts.html | 0 .../unitary-tests/core/sanitizer/input/scripts.svg | 0 .../input/utf-8_wrong_character_email_truncated.txt | 0 .../core/sanitizer/input/whitelist_test.html | 0 .../core/sanitizer/output/scripts.html | 0 .../unitary-tests/core/sanitizer/output/scripts.svg | 0 .../utf-8_wrong_character_email_truncated.txt | 0 .../datamodels/2.x/authent-local/UserLocalTest.php | 2 +- .../UserLocalTest/UserLocalPasswordPolicyMock.php | 0 .../Validator/iTopConfigAstValidatorTest.php | 0 .../Validator/iTopConfigSyntaxValidatorTest.php | 0 .../datamodels/2.x/itop-tickets/itopTicketTest.php | 0 .../unitary-tests/setup/DBBackupTest.php | 0 .../unitary-tests/setup/SetupUtilsTest.php | 0 .../setup/iTopDesignFormat/1.7_to_1.6.expected.xml | 0 .../setup/iTopDesignFormat/1.7_to_1.6.input.xml | 0 .../setup/iTopDesignFormat/iTopDesignFormatTest.php | 0 .../sources/Composer/iTopComposerTest.php | 0 .../sources/application/TwigBase/Twig/TwigTest.php | 0 .../sources/application/TwigBase/Twig/test.html | 0 .../application/TwigBase/Twig/test.html.twig | 0 .../application/search/CriterionConversionTest.php | 0 .../application/search/CriterionParserTest.php | 0 .../sources/application/search/SearchFormTest.php | 0 .../unitary-tests/status/StatusIncTest.php | 0 .../unitary-tests/status/StatusTest.php | 0 .../php-unit-tests/unitary-tests/status/status.php | 0 .../unitary-tests/webservices/RestTest.php | 0 {test => tests}/php-unit-tests/unittestautoload.php | 0 {test => tests}/setup_params/default-params.xml | 0 {test => tests}/setup_params/setup.xml | 0 108 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 test/ci_description.ini rename {test => tests}/backups/backup-itop.tar.gz (100%) create mode 100644 tests/ci_description.ini rename {test => tests}/manual-visual-tests/attributeset_widget_poc.html (100%) rename {test => tests}/manual-visual-tests/sanitize_test.php (100%) rename {test => tests}/php-unit-tests/ItopDataTestCase.php (100%) rename {test => tests}/php-unit-tests/ItopTestCase.php (100%) rename {test => tests}/php-unit-tests/README.md (100%) rename {test => tests}/php-unit-tests/composer.json (100%) rename {test => tests}/php-unit-tests/integration-tests/DictionariesConsistencyTest.php (100%) rename {test => tests}/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php (100%) rename {test => tests}/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/GroupByAndFunctions.php (99%) rename {test => tests}/php-unit-tests/legacy-tests/README.md (100%) rename {test => tests}/php-unit-tests/legacy-tests/VerifyOQL.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/benchmark.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/build_test_oql.php (97%) rename {test => tests}/php-unit-tests/legacy-tests/config-test-farm.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/display_cache_content.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/replay_query_log.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/test.class.inc.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/test.php (100%) rename {test => tests}/php-unit-tests/legacy-tests/testlist.inc.php (100%) rename {test => tests}/php-unit-tests/phpunit.xml.dist (100%) rename {test => tests}/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php (100%) rename {test => tests}/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php (100%) rename {test => tests}/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php (100%) rename {test => tests}/php-unit-tests/postbuild_integration.xml.dist (100%) rename {test => tests}/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/application/utilsTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/CMDBObjectTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBObjectTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBSearchTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ExpressionTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/LogAPITest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/MetaModelTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/OQLParserTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/OQLTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/TriggerTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/UserRightsTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php (97%) rename {test => tests}/php-unit-tests/unitary-tests/core/apcEmulationTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/dictApcuTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/dictTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/mockDict.incphp (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ormLinkSetTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/ormTagSetTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php (99%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/README.txt (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/input/utf-8_wrong_character_email_truncated.txt (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg (100%) rename {test => tests}/php-unit-tests/unitary-tests/core/sanitizer/output/utf-8_wrong_character_email_truncated.txt (100%) rename {test => tests}/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php (98%) rename {test => tests}/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/setup/DBBackupTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml (100%) rename {test => tests}/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml (100%) rename {test => tests}/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/status/StatusIncTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/status/StatusTest.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/status/status.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/webservices/RestTest.php (100%) rename {test => tests}/php-unit-tests/unittestautoload.php (100%) rename {test => tests}/setup_params/default-params.xml (100%) rename {test => tests}/setup_params/setup.xml (100%) diff --git a/.gitignore b/.gitignore index 8a46f7b20..3084ea2c3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ # composer reserver directory, from sources, populate/update using "composer install" vendor/* -test/*/vendor/* +tests/*/vendor/* # all conf but listing prevention /conf/** @@ -33,7 +33,7 @@ test/*/vendor/* !/log/web.config # PHPUnit cache file -/test/php-unit-tests/.phpunit.result.cache +/tests/php-unit-tests/.phpunit.result.cache # Jetbrains diff --git a/test/ci_description.ini b/test/ci_description.ini deleted file mode 100644 index ed14d2c87..000000000 --- a/test/ci_description.ini +++ /dev/null @@ -1,8 +0,0 @@ -[itop] -itop_setup=test/setup_params/default-params.xml -itop_backup=test/backups/backup-itop.tar.gz - -[phpunit] -; when empty phpunit_xml => no phpunit test performed -; phpunit xml file description. required for phpunit testing -phpunit_xml=test/php-unit-tests/phpunit.xml.dist diff --git a/test/backups/backup-itop.tar.gz b/tests/backups/backup-itop.tar.gz similarity index 100% rename from test/backups/backup-itop.tar.gz rename to tests/backups/backup-itop.tar.gz diff --git a/tests/ci_description.ini b/tests/ci_description.ini new file mode 100644 index 000000000..65396a54f --- /dev/null +++ b/tests/ci_description.ini @@ -0,0 +1,8 @@ +[itop] +itop_setup=tests/setup_params/default-params.xml +itop_backup=tests/backups/backup-itop.tar.gz + +[phpunit] +; when empty phpunit_xml => no phpunit test performed +; phpunit xml file description. required for phpunit testing +phpunit_xml=tests/php-unit-tests/phpunit.xml.dist diff --git a/test/manual-visual-tests/attributeset_widget_poc.html b/tests/manual-visual-tests/attributeset_widget_poc.html similarity index 100% rename from test/manual-visual-tests/attributeset_widget_poc.html rename to tests/manual-visual-tests/attributeset_widget_poc.html diff --git a/test/manual-visual-tests/sanitize_test.php b/tests/manual-visual-tests/sanitize_test.php similarity index 100% rename from test/manual-visual-tests/sanitize_test.php rename to tests/manual-visual-tests/sanitize_test.php diff --git a/test/php-unit-tests/ItopDataTestCase.php b/tests/php-unit-tests/ItopDataTestCase.php similarity index 100% rename from test/php-unit-tests/ItopDataTestCase.php rename to tests/php-unit-tests/ItopDataTestCase.php diff --git a/test/php-unit-tests/ItopTestCase.php b/tests/php-unit-tests/ItopTestCase.php similarity index 100% rename from test/php-unit-tests/ItopTestCase.php rename to tests/php-unit-tests/ItopTestCase.php diff --git a/test/php-unit-tests/README.md b/tests/php-unit-tests/README.md similarity index 100% rename from test/php-unit-tests/README.md rename to tests/php-unit-tests/README.md diff --git a/test/php-unit-tests/composer.json b/tests/php-unit-tests/composer.json similarity index 100% rename from test/php-unit-tests/composer.json rename to tests/php-unit-tests/composer.json diff --git a/test/php-unit-tests/integration-tests/DictionariesConsistencyTest.php b/tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php similarity index 100% rename from test/php-unit-tests/integration-tests/DictionariesConsistencyTest.php rename to tests/php-unit-tests/integration-tests/DictionariesConsistencyTest.php diff --git a/test/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php b/tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php similarity index 100% rename from test/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php rename to tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php diff --git a/test/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php b/tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php similarity index 100% rename from test/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php rename to tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php diff --git a/test/php-unit-tests/legacy-tests/GroupByAndFunctions.php b/tests/php-unit-tests/legacy-tests/GroupByAndFunctions.php similarity index 99% rename from test/php-unit-tests/legacy-tests/GroupByAndFunctions.php rename to tests/php-unit-tests/legacy-tests/GroupByAndFunctions.php index 8806dd737..15e2c3e77 100644 --- a/test/php-unit-tests/legacy-tests/GroupByAndFunctions.php +++ b/tests/php-unit-tests/legacy-tests/GroupByAndFunctions.php @@ -41,7 +41,7 @@ else } $bError = false; $oP = new iTopWebPage('Database inconsistencies'); -$oP->set_base(utils::GetAbsoluteUrlAppRoot().'test/'); +$oP->set_base(utils::GetAbsoluteUrlAppRoot().'tests/'); $oP->set_title('Grouping with functions'); $oP->add('

Grouping with functions

'); $oP->add('
'); diff --git a/test/php-unit-tests/legacy-tests/README.md b/tests/php-unit-tests/legacy-tests/README.md similarity index 100% rename from test/php-unit-tests/legacy-tests/README.md rename to tests/php-unit-tests/legacy-tests/README.md diff --git a/test/php-unit-tests/legacy-tests/VerifyOQL.php b/tests/php-unit-tests/legacy-tests/VerifyOQL.php similarity index 100% rename from test/php-unit-tests/legacy-tests/VerifyOQL.php rename to tests/php-unit-tests/legacy-tests/VerifyOQL.php diff --git a/test/php-unit-tests/legacy-tests/benchmark.php b/tests/php-unit-tests/legacy-tests/benchmark.php similarity index 100% rename from test/php-unit-tests/legacy-tests/benchmark.php rename to tests/php-unit-tests/legacy-tests/benchmark.php diff --git a/test/php-unit-tests/legacy-tests/build_test_oql.php b/tests/php-unit-tests/legacy-tests/build_test_oql.php similarity index 97% rename from test/php-unit-tests/legacy-tests/build_test_oql.php rename to tests/php-unit-tests/legacy-tests/build_test_oql.php index 109598ab1..0a3fd8c02 100644 --- a/test/php-unit-tests/legacy-tests/build_test_oql.php +++ b/tests/php-unit-tests/legacy-tests/build_test_oql.php @@ -28,7 +28,7 @@ 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/php-unit-tests/legacy-tests/config-test-farm.php b/tests/php-unit-tests/legacy-tests/config-test-farm.php similarity index 100% rename from test/php-unit-tests/legacy-tests/config-test-farm.php rename to tests/php-unit-tests/legacy-tests/config-test-farm.php diff --git a/test/php-unit-tests/legacy-tests/display_cache_content.php b/tests/php-unit-tests/legacy-tests/display_cache_content.php similarity index 100% rename from test/php-unit-tests/legacy-tests/display_cache_content.php rename to tests/php-unit-tests/legacy-tests/display_cache_content.php diff --git a/test/php-unit-tests/legacy-tests/replay_query_log.php b/tests/php-unit-tests/legacy-tests/replay_query_log.php similarity index 100% rename from test/php-unit-tests/legacy-tests/replay_query_log.php rename to tests/php-unit-tests/legacy-tests/replay_query_log.php diff --git a/test/php-unit-tests/legacy-tests/test.class.inc.php b/tests/php-unit-tests/legacy-tests/test.class.inc.php similarity index 100% rename from test/php-unit-tests/legacy-tests/test.class.inc.php rename to tests/php-unit-tests/legacy-tests/test.class.inc.php diff --git a/test/php-unit-tests/legacy-tests/test.php b/tests/php-unit-tests/legacy-tests/test.php similarity index 100% rename from test/php-unit-tests/legacy-tests/test.php rename to tests/php-unit-tests/legacy-tests/test.php diff --git a/test/php-unit-tests/legacy-tests/testlist.inc.php b/tests/php-unit-tests/legacy-tests/testlist.inc.php similarity index 100% rename from test/php-unit-tests/legacy-tests/testlist.inc.php rename to tests/php-unit-tests/legacy-tests/testlist.inc.php diff --git a/test/php-unit-tests/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist similarity index 100% rename from test/php-unit-tests/phpunit.xml.dist rename to tests/php-unit-tests/phpunit.xml.dist diff --git a/test/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php similarity index 100% rename from test/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php rename to tests/php-unit-tests/post-build-integration-tests/SetupCssIntegrityChecklistTest.php diff --git a/test/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php similarity index 100% rename from test/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php rename to tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php diff --git a/test/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php similarity index 100% rename from test/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php rename to tests/php-unit-tests/post-build-integration-tests/iTopModuleXmlInstallationChecklistTest.php diff --git a/test/php-unit-tests/postbuild_integration.xml.dist b/tests/php-unit-tests/postbuild_integration.xml.dist similarity index 100% rename from test/php-unit-tests/postbuild_integration.xml.dist rename to tests/php-unit-tests/postbuild_integration.xml.dist diff --git a/test/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php b/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php rename to tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php diff --git a/test/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php b/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php rename to tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php diff --git a/test/php-unit-tests/unitary-tests/application/utilsTest.php b/tests/php-unit-tests/unitary-tests/application/utilsTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/application/utilsTest.php rename to tests/php-unit-tests/unitary-tests/application/utilsTest.php diff --git a/test/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php b/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php rename to tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php diff --git a/test/php-unit-tests/unitary-tests/core/CMDBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBObjectTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/CMDBObjectTest.php rename to tests/php-unit-tests/unitary-tests/core/CMDBObjectTest.php diff --git a/test/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php diff --git a/test/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/DeadLockInjection.php diff --git a/test/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php rename to tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php diff --git a/test/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php rename to tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php diff --git a/test/php-unit-tests/unitary-tests/core/ConfigTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ConfigTest.php rename to tests/php-unit-tests/unitary-tests/core/ConfigTest.php diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php rename to tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php rename to tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php rename to tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBObjectTest.php rename to tests/php-unit-tests/unitary-tests/core/DBObjectTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php rename to tests/php-unit-tests/unitary-tests/core/DBSearchCommitTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php rename to tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php rename to tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBSearchTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBSearchTest.php rename to tests/php-unit-tests/unitary-tests/core/DBSearchTest.php diff --git a/test/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php rename to tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php diff --git a/test/php-unit-tests/unitary-tests/core/ExpressionTest.php b/tests/php-unit-tests/unitary-tests/core/ExpressionTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ExpressionTest.php rename to tests/php-unit-tests/unitary-tests/core/ExpressionTest.php diff --git a/test/php-unit-tests/unitary-tests/core/LogAPITest.php b/tests/php-unit-tests/unitary-tests/core/LogAPITest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/LogAPITest.php rename to tests/php-unit-tests/unitary-tests/core/LogAPITest.php diff --git a/test/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php b/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php rename to tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php diff --git a/test/php-unit-tests/unitary-tests/core/MetaModelTest.php b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/MetaModelTest.php rename to tests/php-unit-tests/unitary-tests/core/MetaModelTest.php diff --git a/test/php-unit-tests/unitary-tests/core/OQLParserTest.php b/tests/php-unit-tests/unitary-tests/core/OQLParserTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/OQLParserTest.php rename to tests/php-unit-tests/unitary-tests/core/OQLParserTest.php diff --git a/test/php-unit-tests/unitary-tests/core/OQLTest.php b/tests/php-unit-tests/unitary-tests/core/OQLTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/OQLTest.php rename to tests/php-unit-tests/unitary-tests/core/OQLTest.php diff --git a/test/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php b/tests/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php rename to tests/php-unit-tests/unitary-tests/core/TagSetFieldDataTest.php diff --git a/test/php-unit-tests/unitary-tests/core/TriggerTest.php b/tests/php-unit-tests/unitary-tests/core/TriggerTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/TriggerTest.php rename to tests/php-unit-tests/unitary-tests/core/TriggerTest.php diff --git a/test/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php b/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php rename to tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php diff --git a/test/php-unit-tests/unitary-tests/core/UserRightsTest.php b/tests/php-unit-tests/unitary-tests/core/UserRightsTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/UserRightsTest.php rename to tests/php-unit-tests/unitary-tests/core/UserRightsTest.php diff --git a/test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php rename to tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php diff --git a/test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php similarity index 97% rename from test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php rename to tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php index e7a85f62b..a8cef1666 100644 --- a/test/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php +++ b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php @@ -11,7 +11,7 @@ class WeeklyScheduledProcessTest extends ItopTestCase { parent::setUp(); require_once(APPROOT.'core/backgroundprocess.inc.php'); - require_once(APPROOT.'test/core/WeeklyScheduledProcessMockConfig.php'); + require_once(APPROOT.'tests/core/WeeklyScheduledProcessMockConfig.php'); } diff --git a/test/php-unit-tests/unitary-tests/core/apcEmulationTest.php b/tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/apcEmulationTest.php rename to tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php diff --git a/test/php-unit-tests/unitary-tests/core/dictApcuTest.php b/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/dictApcuTest.php rename to tests/php-unit-tests/unitary-tests/core/dictApcuTest.php diff --git a/test/php-unit-tests/unitary-tests/core/dictTest.php b/tests/php-unit-tests/unitary-tests/core/dictTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/dictTest.php rename to tests/php-unit-tests/unitary-tests/core/dictTest.php diff --git a/test/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php rename to tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php diff --git a/test/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp b/tests/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp similarity index 100% rename from test/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp rename to tests/php-unit-tests/unitary-tests/core/mockApcEmulation.incphp diff --git a/test/php-unit-tests/unitary-tests/core/mockDict.incphp b/tests/php-unit-tests/unitary-tests/core/mockDict.incphp similarity index 100% rename from test/php-unit-tests/unitary-tests/core/mockDict.incphp rename to tests/php-unit-tests/unitary-tests/core/mockDict.incphp diff --git a/test/php-unit-tests/unitary-tests/core/ormLinkSetTest.php b/tests/php-unit-tests/unitary-tests/core/ormLinkSetTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ormLinkSetTest.php rename to tests/php-unit-tests/unitary-tests/core/ormLinkSetTest.php diff --git a/test/php-unit-tests/unitary-tests/core/ormTagSetTest.php b/tests/php-unit-tests/unitary-tests/core/ormTagSetTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/ormTagSetTest.php rename to tests/php-unit-tests/unitary-tests/core/ormTagSetTest.php diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php rename to tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php similarity index 99% rename from test/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php rename to tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php index 28df546ab..f5448e701 100644 --- a/test/php-unit-tests/unitary-tests/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'; + require_once APPROOT.'tests/core/sanitizer/InlineImageMock.php'; InlineImageMock::ResetCallCounter(); $oSanitizer = new HTMLDOMSanitizer(InlineImageMock::class); diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php rename to tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/README.txt b/tests/php-unit-tests/unitary-tests/core/sanitizer/README.txt similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/README.txt rename to tests/php-unit-tests/unitary-tests/core/sanitizer/README.txt diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php rename to tests/php-unit-tests/unitary-tests/core/sanitizer/SvgDOMSanitizerTest.php diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.html diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg b/tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/scripts.svg diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html rename to tests/php-unit-tests/unitary-tests/core/sanitizer/input/whitelist_test.html diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html b/tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html rename to tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.html diff --git a/test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg b/tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg similarity index 100% rename from test/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg rename to tests/php-unit-tests/unitary-tests/core/sanitizer/output/scripts.svg diff --git a/test/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/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/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php similarity index 98% rename from test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php index b82eeee6b..12a1c34f4 100644 --- a/test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php @@ -25,7 +25,7 @@ class UserLocalTest extends ItopDataTestCase { parent::setUp(); - require_once(APPROOT.'test/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); + require_once(APPROOT.'tests/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); require_once(APPROOT.'env-production/authent-local/model.authent-local.php'); } diff --git a/test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php similarity index 100% rename from test/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php diff --git a/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php diff --git a/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php diff --git a/test/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php diff --git a/test/php-unit-tests/unitary-tests/setup/DBBackupTest.php b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/setup/DBBackupTest.php rename to tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php diff --git a/test/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php b/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php rename to tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php diff --git a/test/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 similarity index 100% rename from test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.expected.xml diff --git a/test/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 similarity index 100% rename from test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/1.7_to_1.6.input.xml diff --git a/test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php rename to tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php diff --git a/test/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php b/tests/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php rename to tests/php-unit-tests/unitary-tests/sources/Composer/iTopComposerTest.php diff --git a/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php diff --git a/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html diff --git a/test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/test.html.twig diff --git a/test/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php rename to tests/php-unit-tests/unitary-tests/sources/application/search/CriterionConversionTest.php diff --git a/test/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php rename to tests/php-unit-tests/unitary-tests/sources/application/search/CriterionParserTest.php diff --git a/test/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php b/tests/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php rename to tests/php-unit-tests/unitary-tests/sources/application/search/SearchFormTest.php diff --git a/test/php-unit-tests/unitary-tests/status/StatusIncTest.php b/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/status/StatusIncTest.php rename to tests/php-unit-tests/unitary-tests/status/StatusIncTest.php diff --git a/test/php-unit-tests/unitary-tests/status/StatusTest.php b/tests/php-unit-tests/unitary-tests/status/StatusTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/status/StatusTest.php rename to tests/php-unit-tests/unitary-tests/status/StatusTest.php diff --git a/test/php-unit-tests/unitary-tests/status/status.php b/tests/php-unit-tests/unitary-tests/status/status.php similarity index 100% rename from test/php-unit-tests/unitary-tests/status/status.php rename to tests/php-unit-tests/unitary-tests/status/status.php diff --git a/test/php-unit-tests/unitary-tests/webservices/RestTest.php b/tests/php-unit-tests/unitary-tests/webservices/RestTest.php similarity index 100% rename from test/php-unit-tests/unitary-tests/webservices/RestTest.php rename to tests/php-unit-tests/unitary-tests/webservices/RestTest.php diff --git a/test/php-unit-tests/unittestautoload.php b/tests/php-unit-tests/unittestautoload.php similarity index 100% rename from test/php-unit-tests/unittestautoload.php rename to tests/php-unit-tests/unittestautoload.php diff --git a/test/setup_params/default-params.xml b/tests/setup_params/default-params.xml similarity index 100% rename from test/setup_params/default-params.xml rename to tests/setup_params/default-params.xml diff --git a/test/setup_params/setup.xml b/tests/setup_params/setup.xml similarity index 100% rename from test/setup_params/setup.xml rename to tests/setup_params/setup.xml From 6136eadd31c538bf970392d2f56a01548d4dc652 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 14 Oct 2022 23:07:19 +0200 Subject: [PATCH 12/31] =?UTF-8?q?N=C2=B05608=20-=20Fix=20some=20broken=20r?= =?UTF-8?q?equire=20paths=20since=20move/rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/ItopTestCase.php | 18 ++++++++++-------- tests/php-unit-tests/phpunit.xml.dist | 8 ++++---- .../core/WeeklyScheduledProcessTest.php | 2 +- .../core/sanitizer/HTMLDOMSanitizerTest.php | 2 +- .../2.x/authent-local/UserLocalTest.php | 2 +- .../Validator/iTopConfigAstValidatorTest.php | 4 ++-- .../iTopConfigSyntaxValidatorTest.php | 4 ++-- .../unitary-tests/status/StatusIncTest.php | 2 +- .../unitary-tests/status/status.php | 8 +++++--- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/tests/php-unit-tests/ItopTestCase.php b/tests/php-unit-tests/ItopTestCase.php index 18c6c6a68..afc7c8a28 100644 --- a/tests/php-unit-tests/ItopTestCase.php +++ b/tests/php-unit-tests/ItopTestCase.php @@ -39,14 +39,16 @@ class ItopTestCase extends TestCase /** @noinspection UsingInclusionOnceReturnValueInspection avoid errors for approot includes */ protected function setUp(): void { - @include_once '../approot.inc.php'; - @include_once '../../approot.inc.php'; - @include_once '../../../approot.inc.php'; - @include_once '../../../../approot.inc.php'; - @include_once '../../../../../approot.inc.php'; - @include_once '../../../../../../approot.inc.php'; - @include_once '../../../../../../../approot.inc.php'; - @include_once '../../../../../../../../approot.inc.php'; + $sAppRootRelPath = 'approot.inc.php'; + $sDepthSeparator = '../'; + for ($iDepth = 0; $iDepth < 8; $iDepth++) { + if (file_exists($sAppRootRelPath)) { + require_once $sAppRootRelPath; + break; + } + + $sAppRootRelPath = $sDepthSeparator.$sAppRootRelPath; + } } /** diff --git a/tests/php-unit-tests/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist index 099fb9406..b1cc926bf 100644 --- a/tests/php-unit-tests/phpunit.xml.dist +++ b/tests/php-unit-tests/phpunit.xml.dist @@ -65,16 +65,16 @@ - ../../../env-production/*/test + ../../env-production/*/test - ../../../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/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php index a8cef1666..031a016c1 100644 --- a/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php +++ b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php @@ -11,7 +11,7 @@ class WeeklyScheduledProcessTest extends ItopTestCase { parent::setUp(); require_once(APPROOT.'core/backgroundprocess.inc.php'); - require_once(APPROOT.'tests/core/WeeklyScheduledProcessMockConfig.php'); + require_once(APPROOT.'tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php'); } diff --git a/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php index f5448e701..76c30434a 100644 --- a/tests/php-unit-tests/unitary-tests/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.'tests/core/sanitizer/InlineImageMock.php'; + require_once APPROOT.'tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php'; InlineImageMock::ResetCallCounter(); $oSanitizer = new HTMLDOMSanitizer(InlineImageMock::class); diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php index 12a1c34f4..867a28ed5 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php @@ -25,7 +25,7 @@ class UserLocalTest extends ItopDataTestCase { parent::setUp(); - require_once(APPROOT.'tests/php-unit-tests/tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); + require_once(APPROOT.'tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); require_once(APPROOT.'env-production/authent-local/model.authent-local.php'); } diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php index c29d285d6..68eb076e1 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/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'; + require_once APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php'; + require_once APPROOT.'env-production/itop-config/src/Validator/iTopConfigAstValidator.php'; } diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php index 77427cd94..c4a5aaa1e 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/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'; + require_once APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php'; + require_once APPROOT.'env-production/itop-config/src/Validator/iTopConfigSyntaxValidator.php'; } diff --git a/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php b/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php index 645c9ded5..a135e13de 100644 --- a/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php @@ -38,7 +38,7 @@ class StatusIncTest extends TestCase { { //AppRoot is the directory containing the directory //Assume getcwd() is runned inside APPROOT/test - $this->sAppRoot = __DIR__.'/../../sources/application/status'; + $this->sAppRoot = __DIR__.'/../../../../sources/application/status'; } /** diff --git a/tests/php-unit-tests/unitary-tests/status/status.php b/tests/php-unit-tests/unitary-tests/status/status.php index c81b17aff..3c89ef55e 100644 --- a/tests/php-unit-tests/unitary-tests/status/status.php +++ b/tests/php-unit-tests/unitary-tests/status/status.php @@ -1,8 +1,10 @@ Date: Sat, 15 Oct 2022 21:10:41 +0200 Subject: [PATCH 13/31] =?UTF-8?q?N=C2=B05608=20-=20Move/rename=20"status"?= =?UTF-8?q?=20unit=20tests=20to=20match=20their=20counterpart=20location/n?= =?UTF-8?q?ame?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => sources/application}/status/StatusIncTest.php | 2 +- .../{ => sources/application}/status/StatusTest.php | 0 .../unitary-tests/{ => sources/application}/status/status.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/php-unit-tests/unitary-tests/{ => sources/application}/status/StatusIncTest.php (97%) rename tests/php-unit-tests/unitary-tests/{ => sources/application}/status/StatusTest.php (100%) rename tests/php-unit-tests/unitary-tests/{ => sources/application}/status/status.php (91%) diff --git a/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php similarity index 97% rename from tests/php-unit-tests/unitary-tests/status/StatusIncTest.php rename to tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php index a135e13de..4dc6a559a 100644 --- a/tests/php-unit-tests/unitary-tests/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php @@ -38,7 +38,7 @@ class StatusIncTest extends TestCase { { //AppRoot is the directory containing the directory //Assume getcwd() is runned inside APPROOT/test - $this->sAppRoot = __DIR__.'/../../../../sources/application/status'; + $this->sAppRoot = __DIR__.'/../../../../../../sources/application/status'; } /** diff --git a/tests/php-unit-tests/unitary-tests/status/StatusTest.php b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusTest.php similarity index 100% rename from tests/php-unit-tests/unitary-tests/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/status/status.php b/tests/php-unit-tests/unitary-tests/sources/application/status/status.php similarity index 91% rename from tests/php-unit-tests/unitary-tests/status/status.php rename to tests/php-unit-tests/unitary-tests/sources/application/status/status.php index 3c89ef55e..332e900bf 100644 --- a/tests/php-unit-tests/unitary-tests/status/status.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/status.php @@ -2,7 +2,7 @@ // Include status functions // Important: We can't use the APPROOT constant here as the current script will be executed via the PHP exec() function which won't have it loaded yet. -require_once __DIR__.'/../../../../sources/application/status/status.inc.php'; +require_once __DIR__.'/../../../../../../sources/application/status/status.inc.php'; // Do check Status try From c0cee02351d0586349453de85b82793494f0b98a Mon Sep 17 00:00:00 2001 From: Molkobain Date: Sat, 15 Oct 2022 21:12:47 +0200 Subject: [PATCH 14/31] =?UTF-8?q?N=C2=B05608=20-=20Factorize=20all=20core?= =?UTF-8?q?=20modules=20tests=20to=20a=20single=20test=20suite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/README.md | 3 ++- tests/php-unit-tests/phpunit.xml.dist | 20 ++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/php-unit-tests/README.md b/tests/php-unit-tests/README.md index 04d26c928..e4058802c 100644 --- a/tests/php-unit-tests/README.md +++ b/tests/php-unit-tests/README.md @@ -1,4 +1,5 @@ -# Where should I add my test? +# PHP unitary tests +## Where should I add my test? - Covers an iTop PHP class or method? - Most likely in "unitary-tests". diff --git a/tests/php-unit-tests/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist index b1cc926bf..8273b60c3 100644 --- a/tests/php-unit-tests/phpunit.xml.dist +++ b/tests/php-unit-tests/phpunit.xml.dist @@ -28,24 +28,15 @@ + unitary-tests/application unitary-tests/core - - - unitary-tests/datamodels/2.x/authent-local - - - integration-tests - - - unitary-tests/datamodels/2.x/itop-config - - - unitary-tests/datamodels/2.x/itop-tickets + + unitary-tests/datamodels/2.x unitary-tests/setup @@ -67,6 +58,11 @@ ../../env-production/*/test + + + + integration-tests + From 7de6c7215482dbdfd038b958dcb25146035e34bb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Sun, 16 Oct 2022 11:35:37 +0200 Subject: [PATCH 15/31] Tests: Rename provider method name to match convention --- .../sources/application/TwigBase/Twig/TwigTest.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php index f14420c81..5924d0960 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php @@ -44,17 +44,12 @@ 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; From 5721a324c1989e42448f62b65ca48c0c5f75260b Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 18 Oct 2022 16:52:01 +0200 Subject: [PATCH 16/31] Tests: Always display test status for better feedback --- tests/manual-visual-tests/sanitize_test.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/manual-visual-tests/sanitize_test.php b/tests/manual-visual-tests/sanitize_test.php index 411e86349..cfb7b561f 100644 --- a/tests/manual-visual-tests/sanitize_test.php +++ b/tests/manual-visual-tests/sanitize_test.php @@ -18,7 +18,7 @@ function testSanitize ($sValue, $sType, &$index ){ {$sValue} {$sSanitizedValue} - + HTML; @@ -73,7 +79,10 @@ table, tr, td { border-collapse: collapse; } -td.hasDiff { +.status-success { + color: green; +} +.status-error { color: red; } From 6a7dbb06b00e63093606f3bd641dc2e6e72ea16e Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 6 Jan 2023 17:47:58 +0100 Subject: [PATCH 17/31] =?UTF-8?q?N=C2=B05608=20-=20Add=20methods=20to=20re?= =?UTF-8?q?quire=5Fonce=20an=20iTop=20or=20a=20unit=20test=20file=20to=20a?= =?UTF-8?q?void=20crashes=20when=20tests=20dir=20is=20moved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/ItopTestCase.php | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/php-unit-tests/ItopTestCase.php b/tests/php-unit-tests/ItopTestCase.php index afc7c8a28..94407524d 100644 --- a/tests/php-unit-tests/ItopTestCase.php +++ b/tests/php-unit-tests/ItopTestCase.php @@ -65,6 +65,37 @@ class ItopTestCase extends TestCase } } + /** + * Require once an iTop file (core or extension) from its relative path to the iTop root dir. + * This ensure to always use the right absolute path, especially in {@see \Combodo\iTop\Test\UnitTest\ItopTestCase::RequireOnceUnitTestFile()} + * + * @param string $sFileRelPath Rel. path (from iTop root dir) of the iTop file (core or extension) to require (eg. 'core/attributedef.class.inc.php' for /core/attributedef.class.inc.php) + * + * @return void + * @since 2.7.9 3.0.3 3.1.0 N°5608 Add method after PHPUnit directory moving + */ + protected function RequireOnceItopFile(string $sFileRelPath): void + { + require_once APPROOT . $sFileRelPath; + } + + /** + * Require once a unit test file (eg. a mock class) from its relative path from the *current* dir. + * This ensure that required files don't crash when unit tests dir is moved in the iTop structure (see N°5608) + * + * @param string $sFileRelPath Rel. path (from the *current* dir) of the unit test file to require (eg. './WeeklyScheduledProcessMockConfig.php' for /tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php in Combodo\iTop\Test\UnitTest\Core\WeeklyScheduledProcessTest) + * + * @return void + * @since 2.7.9 3.0.3 3.1.0 N°5608 Add method after PHPUnit directory moving + */ + protected function RequireOnceUnitTestFile(string $sFileRelPath): void + { + $aStack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + $sCallerDirAbsPath = dirname($aStack[0]['file']); + + require_once $sCallerDirAbsPath . DIRECTORY_SEPARATOR . $sFileRelPath; + } + protected function debug($sMsg) { if (DEBUG_UNIT_TEST) { From 36f8e58e25493f031d3092d805d8152f07e5f08e Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 6 Jan 2023 18:22:52 +0100 Subject: [PATCH 18/31] =?UTF-8?q?N=C2=B05608=20-=20Use=20new=20ItopTestCas?= =?UTF-8?q?e::RequireOnceXXX=20in=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/ItopDataTestCase.php | 5 ++--- .../iTopModulesPhpVersionChecklistTest.php | 4 ++-- .../iTopModulesXmlVersionChecklistTest.php | 2 +- .../iTopDesignFormatChecklistTest.php | 4 ++-- .../unitary-tests/core/BulkChangeTest.inc.php | 4 ++-- .../unitary-tests/core/CMDBSource/CMDBSourceTest.php | 2 +- .../unitary-tests/core/CMDBSource/TransactionsTest.php | 2 +- .../unitary-tests/core/ConfigPlaceholdersResolverTest.php | 2 +- tests/php-unit-tests/unitary-tests/core/ConfigTest.php | 2 +- .../core/ConfigValidator/iTopConfigAstValidatorTest.php | 4 ++-- tests/php-unit-tests/unitary-tests/core/DBObjectTest.php | 4 ++-- .../unitary-tests/core/DBSearchIntersectTest.php | 2 +- .../php-unit-tests/unitary-tests/core/DBSearchJoinTest.php | 2 +- tests/php-unit-tests/unitary-tests/core/DBSearchTest.php | 4 ++-- .../unitary-tests/core/DBSearchUpdateRealiasingMapTest.php | 2 +- .../unitary-tests/core/LogFileNameBuilderTest.php | 2 +- tests/php-unit-tests/unitary-tests/core/MetaModelTest.php | 4 ++-- .../unitary-tests/core/UniquenessConstraintTest.php | 4 ++-- .../unitary-tests/core/WeeklyScheduledProcessTest.php | 4 ++-- .../php-unit-tests/unitary-tests/core/apcEmulationTest.php | 2 +- tests/php-unit-tests/unitary-tests/core/dictApcuTest.php | 6 +++--- tests/php-unit-tests/unitary-tests/core/dictTest.php | 6 +++--- .../unitary-tests/core/iTopConfigParserTest.php | 4 ++-- .../core/sanitizer/AbstractDOMSanitizerTest.php | 4 ++-- .../unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php | 2 +- .../datamodels/2.x/authent-local/UserLocalTest.php | 4 ++-- .../itop-config/Validator/iTopConfigAstValidatorTest.php | 4 ++-- .../itop-config/Validator/iTopConfigSyntaxValidatorTest.php | 4 ++-- tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php | 2 +- tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php | 4 ++-- .../setup/iTopDesignFormat/iTopDesignFormatTest.php | 4 ++-- .../sources/application/TwigBase/Twig/TwigTest.php | 3 ++- .../sources/application/status/StatusIncTest.php | 6 +++--- 33 files changed, 57 insertions(+), 57 deletions(-) diff --git a/tests/php-unit-tests/ItopDataTestCase.php b/tests/php-unit-tests/ItopDataTestCase.php index b563e649a..7bc24f57b 100644 --- a/tests/php-unit-tests/ItopDataTestCase.php +++ b/tests/php-unit-tests/ItopDataTestCase.php @@ -80,9 +80,8 @@ class ItopDataTestCase extends ItopTestCase protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'/application/startup.inc.php'); - - require_once(APPROOT.'application/utils.inc.php'); + $this->RequireOnceItopFile('application/startup.inc.php'); + $this->RequireOnceItopFile('application/utils.inc.php'); $sEnv = 'production'; $sConfigFile = APPCONF.$sEnv.'/'.ITOP_CONFIG_FILE; diff --git a/tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php b/tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php index 9c66bda8e..e4b7b5e82 100644 --- a/tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php +++ b/tests/php-unit-tests/integration-tests/iTopModulesPhpVersionChecklistTest.php @@ -64,8 +64,8 @@ class iTopModulesPhpVersionIntegrationTest extends ItopTestCase { parent::setUp(); - require_once APPROOT.'core/config.class.inc.php'; - require_once APPROOT.'application/utils.inc.php'; + $this->RequireOnceItopFile('core/config.class.inc.php'); + $this->RequireOnceItopFile('application/utils.inc.php'); if (is_dir(APPROOT.'datamodels/2.x')) { $DatamodelsPath = APPROOT.'datamodels/2.x'; diff --git a/tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php b/tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php index 3cdb3cc25..de9bafa56 100644 --- a/tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php +++ b/tests/php-unit-tests/integration-tests/iTopModulesXmlVersionChecklistTest.php @@ -31,7 +31,7 @@ class iTopModulesXmlVersionIntegrationTest extends ItopTestCase { parent::setUp(); - require_once APPROOT.'setup/itopdesignformat.class.inc.php'; + $this->RequireOnceItopFile('setup/itopdesignformat.class.inc.php'); } diff --git a/tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php b/tests/php-unit-tests/post-build-integration-tests/iTopDesignFormatChecklistTest.php index 20b1063c1..875fd01ec 100644 --- a/tests/php-unit-tests/post-build-integration-tests/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/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php b/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php index 8fc3c93d0..cdb560b1c 100644 --- a/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php +++ b/tests/php-unit-tests/unitary-tests/core/BulkChangeTest.inc.php @@ -17,8 +17,8 @@ class BulkChangeTest extends ItopDataTestCase { protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'core/coreexception.class.inc.php'); - require_once(APPROOT.'core/bulkchange.class.inc.php'); + $this->RequireOnceItopFile('core/coreexception.class.inc.php'); + $this->RequireOnceItopFile('core/bulkchange.class.inc.php'); } diff --git a/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php index 106bbd91d..986a79a49 100644 --- a/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php +++ b/tests/php-unit-tests/unitary-tests/core/CMDBSource/CMDBSourceTest.php @@ -24,7 +24,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/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php b/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php index 55b738cc8..3a9480be5 100644 --- a/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php +++ b/tests/php-unit-tests/unitary-tests/core/CMDBSource/TransactionsTest.php @@ -31,7 +31,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/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php index a4c6868ea..b4e51ea06 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/ConfigTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigTest.php index 0088ab374..8ab3febc2 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php index b30b67f14..5c64b2ea2 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php index 50d47d67f..3f5630ec3 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBObjectTest.php @@ -43,8 +43,8 @@ class DBObjectTest extends ItopDataTestCase protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'core/coreexception.class.inc.php'); - require_once(APPROOT.'core/dbobject.class.php'); + $this->RequireOnceItopFile('core/coreexception.class.inc.php'); + $this->RequireOnceItopFile('core/dbobject.class.php'); } /** diff --git a/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php index a4d4c4b5b..3fd2d12d9 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBSearchIntersectTest.php @@ -21,7 +21,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/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php index e590eaa53..6790a3010 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBSearchJoinTest.php @@ -22,7 +22,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/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php index 8d29bfc99..19c53b186 100644 --- a/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php +++ b/tests/php-unit-tests/unitary-tests/core/DBSearchTest.php @@ -57,8 +57,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/tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php b/tests/php-unit-tests/unitary-tests/core/DBSearchUpdateRealiasingMapTest.php index 7187e466d..4fd6a3ace 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php b/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php index 09f91e61c..882b04296 100644 --- a/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php +++ b/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php @@ -29,7 +29,7 @@ class LogFileNameBuilderTest extends ItopTestCase { parent::setUp(); - require_once APPROOT.'core/log.class.inc.php'; + $this->RequireOnceItopFile('core/log.class.inc.php'); } protected function tearDown(): void diff --git a/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php index 58b406043..9ce9c27c9 100644 --- a/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php +++ b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php @@ -26,8 +26,8 @@ class MetaModelTest extends ItopDataTestCase protected function setUp(): void { parent::setUp(); - require_once APPROOT.'/core/metamodel.class.php'; - require_once APPROOT.'/core/coreexception.class.inc.php'; + $this->RequireOnceItopFile('/core/metamodel.class.php'); + $this->RequireOnceItopFile('/core/coreexception.class.inc.php'); } /** diff --git a/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php b/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php index 1b724c749..6c3373454 100644 --- a/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php +++ b/tests/php-unit-tests/unitary-tests/core/UniquenessConstraintTest.php @@ -19,8 +19,8 @@ class UniquenessConstraintTest extends ItopTestCase protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'/core/metamodel.class.php'); - require_once(APPROOT.'/core/coreexception.class.inc.php'); + $this->RequireOnceItopFile('core/metamodel.class.php'); + $this->RequireOnceItopFile('core/coreexception.class.inc.php'); } /** diff --git a/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php b/tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessTest.php index 031a016c1..100de4f77 100644 --- a/tests/php-unit-tests/unitary-tests/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.'tests/php-unit-tests/unitary-tests/core/WeeklyScheduledProcessMockConfig.php'); + $this->RequireOnceItopFile('core/backgroundprocess.inc.php'); + $this->RequireOnceUnitTestFile('./WeeklyScheduledProcessMockConfig.php'); } diff --git a/tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php b/tests/php-unit-tests/unitary-tests/core/apcEmulationTest.php index ac088f5a6..a25df610c 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php b/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php index 3207c12ca..fa8e4d19d 100644 --- a/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php +++ b/tests/php-unit-tests/unitary-tests/core/dictApcuTest.php @@ -44,9 +44,9 @@ class dictApcuTest extends ItopTestCase protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php'); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'dict.class.inc.php'); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'dict.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php'); $this->sEnvName = time(); $_SESSION['itop_env'] = $this->sEnvName; diff --git a/tests/php-unit-tests/unitary-tests/core/dictTest.php b/tests/php-unit-tests/unitary-tests/core/dictTest.php index f27473eff..81d49d91b 100644 --- a/tests/php-unit-tests/unitary-tests/core/dictTest.php +++ b/tests/php-unit-tests/unitary-tests/core/dictTest.php @@ -42,9 +42,9 @@ class dictTest extends ItopTestCase protected function setUp(): void { parent::setUp(); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php'); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'dict.class.inc.php'); - require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'dict.class.inc.php'); + $this->RequireOnceItopFile('core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php'); $this->sEnvName = time(); $sDictionaryFolder = APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries"; @mkdir($sDictionaryFolder, 0777, true); diff --git a/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php index e7772ec6c..78addc558 100644 --- a/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php +++ b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php @@ -16,8 +16,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/tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/AbstractDOMSanitizerTest.php index a9fb5d945..f09378dc7 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php b/tests/php-unit-tests/unitary-tests/core/sanitizer/HTMLDOMSanitizerTest.php index 76c30434a..72581c827 100644 --- a/tests/php-unit-tests/unitary-tests/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.'tests/php-unit-tests/unitary-tests/core/sanitizer/InlineImageMock.php'; + $this->RequireOnceUnitTestFile('./InlineImageMock.php'); InlineImageMock::ResetCallCounter(); $oSanitizer = new HTMLDOMSanitizer(InlineImageMock::class); diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php index 867a28ed5..e49ae24e6 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/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.'tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest/UserLocalPasswordPolicyMock.php'); - require_once(APPROOT.'env-production/authent-local/model.authent-local.php'); + $this->RequireOnceUnitTestFile('./UserLocalTest/UserLocalPasswordPolicyMock.php'); + $this->RequireOnceItopFile('env-production/authent-local/model.authent-local.php'); } /** diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php index 68eb076e1..c94292bee 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/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 APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php'; - require_once APPROOT.'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/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php index c4a5aaa1e..fc361a503 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/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 APPROOT.'env-production/itop-config/src/Validator/ConfigNodesVisitor.php'; - require_once APPROOT.'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/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php index 3ad7a2115..390082d16 100644 --- a/tests/php-unit-tests/unitary-tests/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/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php b/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php index b93a9a5f0..d38488bf6 100644 --- a/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/SetupUtilsTest.php @@ -21,8 +21,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/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php index 2d9b83605..cf13231af 100644 --- a/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/iTopDesignFormat/iTopDesignFormatTest.php @@ -19,8 +19,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/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/TwigTest.php index 5924d0960..c01ad8606 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/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,6 +43,7 @@ class TwigTest extends ItopDataTestCase { $oTwig->addFunction($oFunction); } + } public static function testTemplateProvider() { 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 index 4dc6a559a..70c002ce7 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php @@ -92,9 +92,9 @@ class StatusIncTest extends TestCase { include_once($this->sAppRoot . '/status.inc.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'); + 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'); From fbc0a898ae86cbb4b68957766813ac1d5c63fa54 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 6 Jan 2023 18:35:48 +0100 Subject: [PATCH 19/31] =?UTF-8?q?N=C2=B05608=20-=20Move=20test=20files=20t?= =?UTF-8?q?o=20corresponding=20directories=20after=20branch=20rebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../php-unit-tests/unitary-tests}/setup/ModelFactoryTest.php | 2 +- .../unitary-tests/sources}/application/RuntimeDashboardTest.php | 0 .../unitary-tests/sources}/application/TestAutoload.php | 0 .../sources/application/TwigBase/Twig/attacker/backdoor | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename {test => tests/php-unit-tests/unitary-tests}/setup/ModelFactoryTest.php (99%) rename {test => tests/php-unit-tests/unitary-tests/sources}/application/RuntimeDashboardTest.php (100%) rename {test => tests/php-unit-tests/unitary-tests/sources}/application/TestAutoload.php (100%) rename {test => tests}/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor (100%) 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/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/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor b/tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor similarity index 100% rename from test/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor rename to tests/php-unit-tests/unitary-tests/sources/application/TwigBase/Twig/attacker/backdoor From 6aa9aa283138826abd9f5f4d473c7fcb47570b34 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Jan 2023 18:15:53 +0100 Subject: [PATCH 20/31] =?UTF-8?q?N=C2=B05608=20-=20Fix=20unit=20tests=20fo?= =?UTF-8?q?llowing=20restructuring=20Part=20I?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitary-tests/setup/MFCompilerTest.php | 2 +- .../application/status/StatusIncTest.php | 47 +++++++++---------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php b/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php index 4857b9914..f970ae38f 100644 --- a/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php @@ -41,7 +41,7 @@ class MFCompilerTest extends ItopTestCase { } clearstatcache(); $sPrefix = 'scsstest_'; - $sAppRootForProvider = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR; + $sAppRootForProvider = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR; $sTempTargetDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'UseLatestPrecompiledFileProvider'; $sExtensionTargetDir = $sAppRootForProvider . 'extensions/UseLatestPrecompiledFileProvider'; $sSourceDir = $sAppRootForProvider . 'datamodels' . DIRECTORY_SEPARATOR . '2.x'; 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 index e23b986cc..c53240572 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php @@ -12,6 +12,8 @@ namespace Combodo\iTop\Test\UnitTest\Status; * Date: 25/01/2019 */ +use Combodo\iTop\Application\Status\Status; +use Combodo\iTop\Test\UnitTest\ItopTestCase; use Config; use PHPUnit\Framework\TestCase; use function Combodo\iTop\Application\Status\StatusCheckConfigFile; @@ -27,7 +29,7 @@ if (!defined('DEBUG_UNIT_TEST')) { * @preserveGlobalState disabled * @backupGlobals disabled */ -class StatusIncTest extends TestCase { +class StatusIncTest extends ItopTestCase { /** * @var string @@ -36,29 +38,26 @@ class StatusIncTest extends TestCase { protected function setUp(): void { - //AppRoot is the directory containing the directory - //Assume getcwd() is runned inside APPROOT/test - $this->sAppRoot = __DIR__.'/../../../../../../sources/application/status'; + parent::setUp(); + $this->RequireOnceItopFile('sources/application/status/Status.php'); } /** * @expectedException \Exception */ public function testStatusGetAppRootWrongPath() { - include_once($this->sAppRoot . '/Status.php'); - $sAppRootFilenamewrong = 'approot.inc.php_wrong'; - StatusGetAppRoot($sAppRootFilenamewrong); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusGetAppRoot", $oStatus, [$sAppRootFilenamewrong]); } /** * */ public function testStatusGetAppRootGood() { - include_once($this->sAppRoot . '/Status.php'); - - StatusGetAppRoot(); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusGetAppRoot", $oStatus, []); $this->assertNotEmpty(APPROOT); } @@ -67,20 +66,18 @@ class StatusIncTest extends TestCase { * @expectedException \Exception */ public function testStatusCheckConfigFileWrongPath() { - include_once($this->sAppRoot . '/Status.php'); - $sConfigFilenamewrong = 'config-itop.php_wrong'; - StatusCheckConfigFile($sConfigFilenamewrong); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, [$sConfigFilenamewrong]); } /** * */ public function testStatusCheckConfigFileGood() { - include_once($this->sAppRoot . '/Status.php'); - - StatusCheckConfigFile(); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); $this->assertTrue(true); } @@ -89,26 +86,24 @@ class StatusIncTest extends TestCase { * @expectedException \MySQLException */ public function testStatusStartupWrongDbPwd() { - include_once($this->sAppRoot . '/Status.php'); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); - StatusCheckConfigFile(); - require_once(APPROOT . '/core/cmdbobject.class.inc.php'); - require_once(APPROOT . '/application/utils.inc.php'); - require_once(APPROOT . '/core/contexttag.class.inc.php'); + $this->RequireOnceItopFile('core/cmdbobject.class.inc.php'); + $this->RequireOnceItopFile('application/utils.inc.php'); + $this->RequireOnceItopFile('core/contexttag.class.inc.php'); $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd') . '_unittest'); - - StatusStartup($oConfigWrong); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusStartup", $oStatus, [$oConfigWrong]); } /** * */ public function testStatusStartupGood() { - include_once($this->sAppRoot . '/Status.php'); - - StatusStartup(); + $oStatus = new Status(); + $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusStartup", $oStatus, []); $this->assertTrue(true); } From b593beb8c748dee2327ac3ffcbb8bc8ff05d0a0a Mon Sep 17 00:00:00 2001 From: Thomas Casteleyn Date: Tue, 10 Jan 2023 18:53:00 +0100 Subject: [PATCH 21/31] =?UTF-8?q?N=C2=B05867=20Display=20binary=20data=20s?= =?UTF-8?q?ize=20in=20SynchroReplica=20details=20(#286)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- synchro/synchrodatasource.class.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/synchro/synchrodatasource.class.inc.php b/synchro/synchrodatasource.class.inc.php index eb9d32b2c..d02dfd777 100644 --- a/synchro/synchrodatasource.class.inc.php +++ b/synchro/synchrodatasource.class.inc.php @@ -2818,12 +2818,16 @@ class SynchroReplica extends DBObject implements iDisplay $aData = $this->LoadExtendedDataFromTable($sSQLTable); $aHeaders = array( - 'attcode' => array('label' => 'Attribute Code', 'description' => ''), - 'data' => array('label' => 'Value', 'description' => ''), + 'attcode' => array('label' => Dict::S('UI:Form:Property'), 'description' => ''), + 'data' => array('label' => Dict::S('UI:Form:Value'), 'description' => ''), ); $aRows = array(); foreach ($aData as $sKey => $value) { - $aRows[] = array('attcode' => $sKey, 'data' => $value); + if (strpos(CMDBSource::GetFieldType($sSQLTable, $sKey), 'blob') !== false) { + $aRows[] = array('attcode' => $sKey, 'data' => sprintf('%s (%s)', Dict::S('Core:AttributeBlob'), utils::BytesToFriendlyFormat(strlen($value)))); + } else { + $aRows[] = array('attcode' => $sKey, 'data' => utils::EscapeHtml($value)); + } } $oPage->Table($aHeaders, $aRows); $oPage->add(''); From bcf880f3279695958f8b8dfa7a58ad228b90e9a6 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Jan 2023 19:23:37 +0100 Subject: [PATCH 22/31] =?UTF-8?q?N=C2=B05608=20-=20Fix=20unit=20tests=20fo?= =?UTF-8?q?llowing=20restructuring=20Part=20II?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "use_legacy_search" conf param was removed some time ago --- tests/php-unit-tests/unitary-tests/core/OQLTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/php-unit-tests/unitary-tests/core/OQLTest.php b/tests/php-unit-tests/unitary-tests/core/OQLTest.php index c6f71058b..378a4e728 100644 --- a/tests/php-unit-tests/unitary-tests/core/OQLTest.php +++ b/tests/php-unit-tests/unitary-tests/core/OQLTest.php @@ -38,7 +38,6 @@ class OQLTest extends ItopDataTestCase */ public function testOQLSetup() { - utils::GetConfig()->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'); From 7f37de777e8bc05d426a5dca355cd94c03038986 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Jan 2023 21:04:29 +0100 Subject: [PATCH 23/31] =?UTF-8?q?N=C2=B05608=20-=20Fix=20unit=20tests=20fo?= =?UTF-8?q?llowing=20restructuring=20Part=20III?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Missed a usage of "use_legacy_search" conf param on the last commit * Fix log tests which didn't moved correctly from Git PoV 😕 --- .../core/Log/LogFileNameBuilderTest.php | 2 +- .../unitary-tests/core/LogAPITest.php | 143 ---------------- .../core/LogFileNameBuilderTest.php | 160 ------------------ .../unitary-tests/core/OQLTest.php | 1 - 4 files changed, 1 insertion(+), 305 deletions(-) delete mode 100644 tests/php-unit-tests/unitary-tests/core/LogAPITest.php delete mode 100644 tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php diff --git a/tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php b/tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php index e7bdfa923..938bc88c3 100644 --- a/tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php +++ b/tests/php-unit-tests/unitary-tests/core/Log/LogFileNameBuilderTest.php @@ -32,7 +32,7 @@ class LogFileNameBuilderTest extends ItopTestCase { parent::setUp(); - require_once APPROOT.'core/log.class.inc.php'; + $this->RequireOnceItopFile('core/log.class.inc.php'); } protected function tearDown(): void diff --git a/tests/php-unit-tests/unitary-tests/core/LogAPITest.php b/tests/php-unit-tests/unitary-tests/core/LogAPITest.php deleted file mode 100644 index 7f253ddf9..000000000 --- a/tests/php-unit-tests/unitary-tests/core/LogAPITest.php +++ /dev/null @@ -1,143 +0,0 @@ -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 deleted file mode 100644 index 882b04296..000000000 --- a/tests/php-unit-tests/unitary-tests/core/LogFileNameBuilderTest.php +++ /dev/null @@ -1,160 +0,0 @@ -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/tests/php-unit-tests/unitary-tests/core/OQLTest.php b/tests/php-unit-tests/unitary-tests/core/OQLTest.php index 378a4e728..d6d7674ae 100644 --- a/tests/php-unit-tests/unitary-tests/core/OQLTest.php +++ b/tests/php-unit-tests/unitary-tests/core/OQLTest.php @@ -317,7 +317,6 @@ class OQLTest extends ItopDataTestCase 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')); From 5916e4ea396155676ccb3d94d2f02ce9f9ddbfeb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Jan 2023 22:03:40 +0100 Subject: [PATCH 24/31] =?UTF-8?q?N=C2=B05608=20-=20Ensure=20both=20old=20&?= =?UTF-8?q?=20new=20tests=20structure=20are=20ran=20for=20extensions=20for?= =?UTF-8?q?=20backward=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/php-unit-tests/phpunit.xml.dist b/tests/php-unit-tests/phpunit.xml.dist index 8273b60c3..f16e89560 100644 --- a/tests/php-unit-tests/phpunit.xml.dist +++ b/tests/php-unit-tests/phpunit.xml.dist @@ -57,6 +57,7 @@ ../../env-production/*/test + ../../env-production/*/tests/php-unit-tests From 845adf43c678450c8a2f787cc6047da85bbd1919 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Jan 2023 22:04:20 +0100 Subject: [PATCH 25/31] =?UTF-8?q?N=C2=B05608=20-=20Harmonize=20namespaces?= =?UTF-8?q?=20and=20merge=20duplicated=20test=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/DashboardLayoutTest.php | 2 + .../application/privUITransactionFileTest.php | 5 + .../unitary-tests/application/utilsTest.php | 3 + .../config-itop_KO_config_plus_code.php | 392 ----------------- .../config-itop_KO_function.php | 7 - .../ConfigValidator/config-itop_VALID.php | 390 ----------------- .../config-itop_VALID_log-level-min_const.php | 394 ------------------ .../iTopConfigAstValidatorTest.php | 69 --- .../2.x/authent-local/UserLocalTest.php | 2 +- .../ConfigPlaceholdersResolverTest.php | 2 +- .../2.x/itop-config}/ConfigTest.php | 2 +- .../ConfigTest/config-itop-joker.php | 0 .../ConfigTest/config-itop-var.php | 0 .../Validator/iTopConfigAstValidatorTest.php | 3 +- .../iTopConfigSyntaxValidatorTest.php | 2 +- .../2.x/itop-tickets/itopTicketTest.php | 2 +- .../unitary-tests/setup/DBBackupTest.php | 2 +- .../unitary-tests/setup/ModelFactoryTest.php | 2 +- 18 files changed, 18 insertions(+), 1261 deletions(-) delete mode 100644 tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php delete mode 100644 tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php delete mode 100644 tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID.php delete mode 100644 tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php delete mode 100644 tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php rename tests/php-unit-tests/unitary-tests/{core => datamodels/2.x/itop-config}/ConfigPlaceholdersResolverTest.php (99%) rename tests/php-unit-tests/unitary-tests/{core => datamodels/2.x/itop-config}/ConfigTest.php (98%) rename tests/php-unit-tests/unitary-tests/{core => datamodels/2.x/itop-config}/ConfigTest/config-itop-joker.php (100%) rename tests/php-unit-tests/unitary-tests/{core => datamodels/2.x/itop-config}/ConfigTest/config-itop-var.php (100%) diff --git a/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php b/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php index b6a552cd5..461c1a7fa 100644 --- a/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php +++ b/tests/php-unit-tests/unitary-tests/application/DashboardLayoutTest.php @@ -17,6 +17,8 @@ * You should have received a copy of the GNU Affero General Public License */ +namespace Combodo\iTop\Test\UnitTest\Application; + use Combodo\iTop\Test\UnitTest\ItopTestCase; /** diff --git a/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php b/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php index adfb86cbf..0a45834d1 100644 --- a/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php +++ b/tests/php-unit-tests/unitary-tests/application/privUITransactionFileTest.php @@ -17,7 +17,12 @@ * You should have received a copy of the GNU Affero General Public License */ +namespace Combodo\iTop\Test\UnitTest\Application; + use Combodo\iTop\Test\UnitTest\ItopDataTestCase; +use MetaModel; +use privUITransactionFile; +use UserRights; /** * @runTestsInSeparateProcesses diff --git a/tests/php-unit-tests/unitary-tests/application/utilsTest.php b/tests/php-unit-tests/unitary-tests/application/utilsTest.php index 354146b7c..84205537b 100644 --- a/tests/php-unit-tests/unitary-tests/application/utilsTest.php +++ b/tests/php-unit-tests/unitary-tests/application/utilsTest.php @@ -19,7 +19,10 @@ * */ +namespace Combodo\iTop\Test\UnitTest\Application; + use Combodo\iTop\Test\UnitTest\ItopTestCase; +use utils; /** * @covers utils diff --git a/tests/php-unit-tests/unitary-tests/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 deleted file mode 100644 index 1db98d9f7..000000000 --- a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_config_plus_code.php +++ /dev/null @@ -1,392 +0,0 @@ - 'iTop is temporarily frozen, please wait... (the admin team)', - - // access_mode: Access mode: ACCESS_READONLY = 0, ACCESS_ADMIN_WRITE = 2, ACCESS_FULL = 3 - // default: 3 - 'access_mode' => 3, - - // activity_panel.entry_form_opened_by_default: Whether or not the new entry form will be automatically opened when viewing an object. - // default: false - 'activity_panel.entry_form_opened_by_default' => false, - - // activity_panel.show_author_name_below_entries: Whether or not to show the author friendlyname next to the date on the last entry. - // default: false - 'activity_panel.show_author_name_below_entries' => false, - - 'allowed_login_types' => 'form|external|basic', - - // apc_cache.enabled: If set, the APC cache is allowed (the PHP extension must also be active) - // default: true - 'apc_cache.enabled' => true, - - // apc_cache.query_ttl: Time to live set in APC for the prepared queries (seconds - 0 means no timeout) - // default: 3600 - 'apc_cache.query_ttl' => 3600, - - // app_root_url: Root URL used for navigating within the application, or from an email to the application (you can put $SERVER_NAME$ as a placeholder for the server's name) - // default: '' - 'app_root_url' => 'http://localhost/itop-dev/', - - // behind_reverse_proxy: If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy) - // default: false - 'behind_reverse_proxy' => false, - - // cron_max_execution_time: Duration (seconds) of the page cron.php, must be shorter than php setting max_execution_time and shorter than the web server response timeout - // default: 600 - 'cron_max_execution_time' => 600, - - // csv_file_default_charset: Character set used by default for downloading and uploading data as a CSV file. Warning: it is case sensitive (uppercase is preferable). - // default: 'ISO-8859-1' - 'csv_file_default_charset' => 'ISO-8859-1', - - 'csv_import_charsets' => array(), - - // csv_import_history_display: Display the history tab in the import wizard - // default: false - 'csv_import_history_display' => false, - - // date_and_time_format: Format for date and time display (per language) - // default: array ( - // 'default' => - // array ( - // 'date' => 'Y-m-d', - // 'time' => 'H:i:s', - // 'date_time' => '$date $time', - // ), - // ) - 'date_and_time_format' => array( - 'default' => - array( - 'date' => 'Y-m-d', - 'time' => 'H:i:s', - 'date_time' => '$date $time', - ), - ), - - 'db_host' => 'localhost', - - 'db_name' => 'itop_dev', - - 'db_pwd' => '', - - 'db_subname' => '', - - 'db_user' => 'root', - - // deadline_format: The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$ - // default: '$difference$' - 'deadline_format' => '$difference$', - - 'default_language' => 'EN US', - - // email_asynchronous: If set, the emails are sent off line, which requires cron.php to be activated. Exception: some features like the email test utility will force the serialized mode - // default: false - 'email_asynchronous' => false, - - // email_default_sender_address: Default address provided in the email from header field. - // default: '' - 'email_default_sender_address' => '', - - // email_default_sender_label: Default label provided in the email from header field. - // default: '' - 'email_default_sender_label' => '', - - // email_transport: Mean to send emails: PHPMail (uses the function mail()) or SMTP (implements the client protocol) - // default: 'PHPMail' - 'email_transport' => 'PHPMail', - - // email_validation_pattern: Regular expression to validate/detect the format of an eMail address - // default: '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}' - 'email_validation_pattern' => '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}', - - 'encryption_key' => '061c5b88c47ed64664618cf37b91a442b5550704aacecc5f58f96fc98087333b', - - 'encryption_library' => 'OpenSSL', - - 'ext_auth_variable' => '$_SERVER[\'REMOTE_USER\']', - - 'fast_reload_interval' => 60, - - // graphviz_path: Path to the Graphviz "dot" executable for graphing objects lifecycle - // default: '/usr/bin/dot' - 'graphviz_path' => 'C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe', - - // high_cardinality_classes: List of classes with high cardinality (Force manual submit of search) - // default: array ( - // ) - 'high_cardinality_classes' => array(), - - // inline_image_max_display_width: The maximum width (in pixels) when displaying images inside an HTML formatted attribute. Images will be displayed using this this maximum width. - // default: '250' - 'inline_image_max_display_width' => '250', - - // inline_image_max_storage_width: The maximum width (in pixels) when uploading images to be used inside an HTML formatted attribute. Images larger than the given size will be downsampled before storing them in the database. - // default: '1600' - 'inline_image_max_storage_width' => '1600', - - // link_set_attribute_qualifier: Link set from string: attribute qualifier (encloses both the attcode and the value) - // default: '\'' - 'link_set_attribute_qualifier' => '\'', - - // link_set_attribute_separator: Link set from string: attribute separator - // default: ';' - 'link_set_attribute_separator' => ';', - - // link_set_item_separator: Link set from string: line separator - // default: '|' - 'link_set_item_separator' => '|', - - // link_set_value_separator: Link set from string: value separator (between the attcode and the value itself - // default: ':' - 'link_set_value_separator' => ':', - - 'log_global' => true, - - 'log_issue' => true, - - 'log_kpi_duration' => 0, - - 'log_notification' => true, - - 'log_web_service' => true, - - 'max_display_limit' => 30, - - // max_linkset_output: Maximum number of items shown when getting a list of related items in an email, using the form $this->some_list$. 0 means no limit. - // default: 100 - 'max_linkset_output' => 100, - - // mentions.allowed_classes: Classes which can be mentioned through the autocomplete in the caselogs. Key of the array must be a single character that will trigger the autocomplete, value can be either a DM class or a valid OQL (eg. "@" => "Person", "?" => "SELECT FAQ WHERE status = 'published'") - // default: array ( - // '@' => 'SELECT Person WHERE status = \'active\'', - // ) - 'mentions.allowed_classes' => array( - '@' => 'SELECT Person WHERE status = \'active\'', - ), - - 'min_display_limit' => 20, - - // online_help: Hyperlink to the online-help web page - // default: 'http://www.combodo.com/itop-help' - 'online_help' => 'http://www.combodo.com/itop-help', - - // optimize_requests_for_join_count: Optimize request joins to minimize the count (default is true, try to set it to false in case of performance issues) - // default: true - 'optimize_requests_for_join_count' => true, - - 'password_hash_algo' => '2y', - - // php_path: Path to the php executable in CLI mode - // default: 'php' - 'php_path' => 'php', - - // search_manual_submit: Force manual submit of search all requests - // default: false - 'search_manual_submit' => false, - - 'secure_connection_required' => false, - - // session_name: The name of the cookie used to store the PHP session id - // default: 'iTop' - 'session_name' => 'iTop', - - // shortcut_actions: Actions that are available as direct buttons next to the "Actions" menu - // default: 'UI:Menu:Modify,UI:Menu:New' - 'shortcut_actions' => 'UI:Menu:Modify,UI:Menu:New', - - // source_dir: Source directory for the datamodel files. (which gets compiled to env-production). - // default: '' - 'source_dir' => 'datamodels/2.x/', - - 'standard_reload_interval' => 300, - - // synchro_trace: Synchronization details: none, display, save (includes 'display') - // default: 'none' - 'synchro_trace' => 'none', - - // tag_set_item_separator: Tag set from string: tag label separator - // default: '|' - 'tag_set_item_separator' => '|', - - // timezone: Timezone (reference: http://php.net/manual/en/timezones.php). If empty, it will be left unchanged and MUST be explicitly configured in PHP - // default: 'Europe/Paris' - 'timezone' => 'Europe/Paris', - - // tracking_level_linked_set_default: Default tracking level if not explicitly set at the attribute level, for AttributeLinkedSet (defaults to NONE in case of a fresh install, LIST otherwise - this to preserve backward compatibility while upgrading from a version older than 2.0.3 - see TRAC #936) - // default: 1 - 'tracking_level_linked_set_default' => 0, - - // url_validation_pattern: Regular expression to validate/detect the format of an URL (URL attributes and Wiki formatting for Text attributes) - // default: '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?' - 'url_validation_pattern' => '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?', -); - -/** - * - * Modules specific settings - * - */ -$MyModuleSettings = array( - 'authent-cas' => array( - 'cas_debug' => false, - 'cas_host' => '', - 'cas_port' => '', - 'cas_context' => '', - 'cas_version' => '', - ), - 'authent-ldap' => array( - 'host' => 'localhost', - 'port' => 389, - 'default_user' => '', - 'default_pwd' => '', - 'base_dn' => 'dc=yourcompany,dc=com', - 'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', - 'options' => array( - 17 => 3, - 8 => 0, - ), - 'start_tls' => false, - 'debug' => false, - ), - 'itop-attachments' => array( - 'allowed_classes' => array( - 0 => 'Ticket', - ), - 'position' => 'relations', - 'preview_max_width' => 290, - 'icon_preview_max_size' => 500000, - ), - 'itop-backup' => array( - 'mysql_bindir' => '', - 'week_days' => 'monday, tuesday, wednesday, thursday, friday', - 'time' => '23:30', - 'retention_count' => 5, - 'enabled' => true, - 'itop_backup_incident' => '', - ), - 'molkobain-console-tooltips' => array( - 'decoration_class' => 'fas fa-question', - 'enabled' => true, - ), - 'itop-time-tracking' => array( - 'allowed_classes' => array( - 'UserRequest' => - array( - 'calendar-tab' => 'SELECT UserRequest WHERE status != "closed"', - 'stopwatch' => 'SELECT UserRequest WHERE status != "closed"', - 'report-tab' => 'SELECT UserRequest WHERE status IN ("resolved", "closed")', - ), - 'Incident' => - array( - 'calendar-tab' => 'SELECT Incident WHERE status != "closed"', - 'stopwatch' => 'SELECT Incident WHERE status != "closed"', - 'report-tab' => 'SELECT Incident WHERE status IN ("resolved", "closed")', - ), - 'CustomerContract' => - array( - 'calendar-page' => 'SELECT CustomerContract WHERE status = "production"', - 'report-tab' => 'SELECT CustomerContract', - ), - ), - 'colors' => array( - 'default_stopwatch' => - array( - 'text' => '#ffffff', - 'background' => '#a6a6a6', - ), - 'default_calendar' => - array( - 'text' => '#ffffff', - 'background' => '#FFCC80', - ), - 'classes' => - array( - 'UserRequest' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:blue', - ), - 'Incident' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:green', - ), - 'CustomerContract' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:grey', - ), - ), - ), - 'clone_events' => false, - 'default_event_duration' => '00:30:00', - 'day_start_time' => '06:00:00', - 'day_end_time' => '22:00:00', - 'excluded_days' => array( - 0 => 'Saturday', - 1 => 'Sunday', - ), - 'first_day' => 1, - 'business_hours' => array( - 'days_of_week' => - array( - 0 => '1', - 1 => '2', - 2 => '3', - 3 => '4', - 4 => '5', - ), - 'start' => '08:00:00', - 'end' => '18:00:00', - ), - 'minimum_event_duration_display' => '00:30:00', - 'stopwatch_clean_periodicity' => 1, - 'stopwatch_max_time' => 4, - 'delete_max_event_age' => 30, - 'default_report_query' => 'SELECT TimeSpent WHERE contact_id = :contact_id AND start_date >= :start_date AND end_date < :end_date', - 'manager_report_query' => 'SELECT TimeSpent WHERE start_date >= :start_date AND end_date < :end_date', - 'manager_report_silo' => 'SELECT Person', - 'weekly_report_time_spent_attribute' => '', - 'weekly_report_time_spent_default' => '30hrs', - 'report_charts_definition' => array( - 0 => - array( - 'group_by_attribute' => 'contact_id', - 'label' => 'TimeTracking:ReportActivityPerUser', - ), - 1 => - array( - 'group_by_attribute' => 'org_id', - 'label' => 'TimeTracking:ReportActivityPerCustomer', - ), - ), - ), -); - -/** - * - * Data model modules to be loaded. Names are specified as relative paths - * - */ -$MyModules = array( - 'addons' => array( - 'user rights' => 'addons/userrights/userrightsprofile.class.inc.php', - ), -); - - -echo 'tutu'; - -?> \ No newline at end of file diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php deleted file mode 100644 index b6664cc95..000000000 --- a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_KO_function.php +++ /dev/null @@ -1,7 +0,0 @@ - 'iTop is temporarily frozen, please wait... (the admin team)', - - // access_mode: Access mode: ACCESS_READONLY = 0, ACCESS_ADMIN_WRITE = 2, ACCESS_FULL = 3 - // default: 3 - 'access_mode' => 3, - - // activity_panel.entry_form_opened_by_default: Whether or not the new entry form will be automatically opened when viewing an object. - // default: false - 'activity_panel.entry_form_opened_by_default' => false, - - // activity_panel.show_author_name_below_entries: Whether or not to show the author friendlyname next to the date on the last entry. - // default: false - 'activity_panel.show_author_name_below_entries' => false, - - 'allowed_login_types' => 'form|external|basic', - - // apc_cache.enabled: If set, the APC cache is allowed (the PHP extension must also be active) - // default: true - 'apc_cache.enabled' => true, - - // apc_cache.query_ttl: Time to live set in APC for the prepared queries (seconds - 0 means no timeout) - // default: 3600 - 'apc_cache.query_ttl' => 3600, - - // app_root_url: Root URL used for navigating within the application, or from an email to the application (you can put $SERVER_NAME$ as a placeholder for the server's name) - // default: '' - 'app_root_url' => 'http://localhost/itop-dev/', - - // behind_reverse_proxy: If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy) - // default: false - 'behind_reverse_proxy' => false, - - // cron_max_execution_time: Duration (seconds) of the page cron.php, must be shorter than php setting max_execution_time and shorter than the web server response timeout - // default: 600 - 'cron_max_execution_time' => 600, - - // csv_file_default_charset: Character set used by default for downloading and uploading data as a CSV file. Warning: it is case sensitive (uppercase is preferable). - // default: 'ISO-8859-1' - 'csv_file_default_charset' => 'ISO-8859-1', - - 'csv_import_charsets' => array ( - ), - - // csv_import_history_display: Display the history tab in the import wizard - // default: false - 'csv_import_history_display' => false, - - // date_and_time_format: Format for date and time display (per language) - // default: array ( - // 'default' => - // array ( - // 'date' => 'Y-m-d', - // 'time' => 'H:i:s', - // 'date_time' => '$date $time', - // ), - // ) - 'date_and_time_format' => array ( - 'default' => - array ( - 'date' => 'Y-m-d', - 'time' => 'H:i:s', - 'date_time' => '$date $time', - ), - ), - - 'db_host' => 'localhost', - - 'db_name' => 'itop_dev', - - 'db_pwd' => '', - - 'db_subname' => '', - - 'db_user' => 'root', - - // deadline_format: The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$ - // default: '$difference$' - 'deadline_format' => '$difference$', - - 'default_language' => 'EN US', - - // email_asynchronous: If set, the emails are sent off line, which requires cron.php to be activated. Exception: some features like the email test utility will force the serialized mode - // default: false - 'email_asynchronous' => false, - - // email_default_sender_address: Default address provided in the email from header field. - // default: '' - 'email_default_sender_address' => '', - - // email_default_sender_label: Default label provided in the email from header field. - // default: '' - 'email_default_sender_label' => '', - - // email_transport: Mean to send emails: PHPMail (uses the function mail()) or SMTP (implements the client protocol) - // default: 'PHPMail' - 'email_transport' => 'PHPMail', - - // email_validation_pattern: Regular expression to validate/detect the format of an eMail address - // default: '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}' - 'email_validation_pattern' => '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}', - - 'encryption_key' => '061c5b88c47ed64664618cf37b91a442b5550704aacecc5f58f96fc98087333b', - - 'encryption_library' => 'OpenSSL', - - 'ext_auth_variable' => '$_SERVER[\'REMOTE_USER\']', - - 'fast_reload_interval' => 60, - - // graphviz_path: Path to the Graphviz "dot" executable for graphing objects lifecycle - // default: '/usr/bin/dot' - 'graphviz_path' => 'C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe', - - // high_cardinality_classes: List of classes with high cardinality (Force manual submit of search) - // default: array ( - // ) - 'high_cardinality_classes' => array ( - ), - - // inline_image_max_display_width: The maximum width (in pixels) when displaying images inside an HTML formatted attribute. Images will be displayed using this this maximum width. - // default: '250' - 'inline_image_max_display_width' => '250', - - // inline_image_max_storage_width: The maximum width (in pixels) when uploading images to be used inside an HTML formatted attribute. Images larger than the given size will be downsampled before storing them in the database. - // default: '1600' - 'inline_image_max_storage_width' => '1600', - - // link_set_attribute_qualifier: Link set from string: attribute qualifier (encloses both the attcode and the value) - // default: '\'' - 'link_set_attribute_qualifier' => '\'', - - // link_set_attribute_separator: Link set from string: attribute separator - // default: ';' - 'link_set_attribute_separator' => ';', - - // link_set_item_separator: Link set from string: line separator - // default: '|' - 'link_set_item_separator' => '|', - - // link_set_value_separator: Link set from string: value separator (between the attcode and the value itself - // default: ':' - 'link_set_value_separator' => ':', - - 'log_global' => true, - - 'log_issue' => true, - - 'log_kpi_duration' => 0, - - 'log_notification' => true, - - 'log_web_service' => true, - - 'max_display_limit' => 30, - - // max_linkset_output: Maximum number of items shown when getting a list of related items in an email, using the form $this->some_list$. 0 means no limit. - // default: 100 - 'max_linkset_output' => 100, - - // mentions.allowed_classes: Classes which can be mentioned through the autocomplete in the caselogs. Key of the array must be a single character that will trigger the autocomplete, value can be either a DM class or a valid OQL (eg. "@" => "Person", "?" => "SELECT FAQ WHERE status = 'published'") - // default: array ( - // '@' => 'SELECT Person WHERE status = \'active\'', - // ) - 'mentions.allowed_classes' => array ( - '@' => 'SELECT Person WHERE status = \'active\'', - ), - - 'min_display_limit' => 20, - - // online_help: Hyperlink to the online-help web page - // default: 'http://www.combodo.com/itop-help' - 'online_help' => 'http://www.combodo.com/itop-help', - - // optimize_requests_for_join_count: Optimize request joins to minimize the count (default is true, try to set it to false in case of performance issues) - // default: true - 'optimize_requests_for_join_count' => true, - - 'password_hash_algo' => '2y', - - // php_path: Path to the php executable in CLI mode - // default: 'php' - 'php_path' => 'php', - - // search_manual_submit: Force manual submit of search all requests - // default: false - 'search_manual_submit' => false, - - 'secure_connection_required' => false, - - // session_name: The name of the cookie used to store the PHP session id - // default: 'iTop' - 'session_name' => 'iTop', - - // shortcut_actions: Actions that are available as direct buttons next to the "Actions" menu - // default: 'UI:Menu:Modify,UI:Menu:New' - 'shortcut_actions' => 'UI:Menu:Modify,UI:Menu:New', - - // source_dir: Source directory for the datamodel files. (which gets compiled to env-production). - // default: '' - 'source_dir' => 'datamodels/2.x/', - - 'standard_reload_interval' => 300, - - // synchro_trace: Synchronization details: none, display, save (includes 'display') - // default: 'none' - 'synchro_trace' => 'none', - - // tag_set_item_separator: Tag set from string: tag label separator - // default: '|' - 'tag_set_item_separator' => '|', - - // timezone: Timezone (reference: http://php.net/manual/en/timezones.php). If empty, it will be left unchanged and MUST be explicitly configured in PHP - // default: 'Europe/Paris' - 'timezone' => 'Europe/Paris', - - // tracking_level_linked_set_default: Default tracking level if not explicitly set at the attribute level, for AttributeLinkedSet (defaults to NONE in case of a fresh install, LIST otherwise - this to preserve backward compatibility while upgrading from a version older than 2.0.3 - see TRAC #936) - // default: 1 - 'tracking_level_linked_set_default' => 0, - - // url_validation_pattern: Regular expression to validate/detect the format of an URL (URL attributes and Wiki formatting for Text attributes) - // default: '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?' - 'url_validation_pattern' => '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?', -); - -/** - * - * Modules specific settings - * - */ -$MyModuleSettings = array( - 'authent-cas' => array ( - 'cas_debug' => false, - 'cas_host' => '', - 'cas_port' => '', - 'cas_context' => '', - 'cas_version' => '', - ), - 'authent-ldap' => array ( - 'host' => 'localhost', - 'port' => 389, - 'default_user' => '', - 'default_pwd' => '', - 'base_dn' => 'dc=yourcompany,dc=com', - 'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', - 'options' => array ( - 17 => 3, - 8 => 0, - ), - 'start_tls' => false, - 'debug' => false, - ), - 'itop-attachments' => array ( - 'allowed_classes' => array ( - 0 => 'Ticket', - ), - 'position' => 'relations', - 'preview_max_width' => 290, - 'icon_preview_max_size' => 500000, - ), - 'itop-backup' => array ( - 'mysql_bindir' => '', - 'week_days' => 'monday, tuesday, wednesday, thursday, friday', - 'time' => '23:30', - 'retention_count' => 5, - 'enabled' => true, - 'itop_backup_incident' => '', - ), - 'molkobain-console-tooltips' => array ( - 'decoration_class' => 'fas fa-question', - 'enabled' => true, - ), - 'itop-time-tracking' => array ( - 'allowed_classes' => array ( - 'UserRequest' => - array ( - 'calendar-tab' => 'SELECT UserRequest WHERE status != "closed"', - 'stopwatch' => 'SELECT UserRequest WHERE status != "closed"', - 'report-tab' => 'SELECT UserRequest WHERE status IN ("resolved", "closed")', - ), - 'Incident' => - array ( - 'calendar-tab' => 'SELECT Incident WHERE status != "closed"', - 'stopwatch' => 'SELECT Incident WHERE status != "closed"', - 'report-tab' => 'SELECT Incident WHERE status IN ("resolved", "closed")', - ), - 'CustomerContract' => - array ( - 'calendar-page' => 'SELECT CustomerContract WHERE status = "production"', - 'report-tab' => 'SELECT CustomerContract', - ), - ), - 'colors' => array ( - 'default_stopwatch' => - array ( - 'text' => '#ffffff', - 'background' => '#a6a6a6', - ), - 'default_calendar' => - array ( - 'text' => '#ffffff', - 'background' => '#FFCC80', - ), - 'classes' => - array ( - 'UserRequest' => - array ( - 'text' => '#ffffff', - 'background' => 'shadeof:blue', - ), - 'Incident' => - array ( - 'text' => '#ffffff', - 'background' => 'shadeof:green', - ), - 'CustomerContract' => - array ( - 'text' => '#ffffff', - 'background' => 'shadeof:grey', - ), - ), - ), - 'clone_events' => false, - 'default_event_duration' => '00:30:00', - 'day_start_time' => '06:00:00', - 'day_end_time' => '22:00:00', - 'excluded_days' => array ( - 0 => 'Saturday', - 1 => 'Sunday', - ), - 'first_day' => 1, - 'business_hours' => array ( - 'days_of_week' => - array ( - 0 => '1', - 1 => '2', - 2 => '3', - 3 => '4', - 4 => '5', - ), - 'start' => '08:00:00', - 'end' => '18:00:00', - ), - 'minimum_event_duration_display' => '00:30:00', - 'stopwatch_clean_periodicity' => 1, - 'stopwatch_max_time' => 4, - 'delete_max_event_age' => 30, - 'default_report_query' => 'SELECT TimeSpent WHERE contact_id = :contact_id AND start_date >= :start_date AND end_date < :end_date', - 'manager_report_query' => 'SELECT TimeSpent WHERE start_date >= :start_date AND end_date < :end_date', - 'manager_report_silo' => 'SELECT Person', - 'weekly_report_time_spent_attribute' => '', - 'weekly_report_time_spent_default' => '30hrs', - 'report_charts_definition' => array ( - 0 => - array ( - 'group_by_attribute' => 'contact_id', - 'label' => 'TimeTracking:ReportActivityPerUser', - ), - 1 => - array ( - 'group_by_attribute' => 'org_id', - 'label' => 'TimeTracking:ReportActivityPerCustomer', - ), - ), - ), -); - -/** - * - * Data model modules to be loaded. Names are specified as relative paths - * - */ -$MyModules = array( - 'addons' => array ( - 'user rights' => 'addons/userrights/userrightsprofile.class.inc.php', - ), -); -?> \ No newline at end of file diff --git a/tests/php-unit-tests/unitary-tests/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 deleted file mode 100644 index 1d59e53c1..000000000 --- a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/config-itop_VALID_log-level-min_const.php +++ /dev/null @@ -1,394 +0,0 @@ - 'iTop is temporarily frozen, please wait... (the admin team)', - - // access_mode: Access mode: ACCESS_READONLY = 0, ACCESS_ADMIN_WRITE = 2, ACCESS_FULL = 3 - // default: 3 - 'access_mode' => 3, - - // activity_panel.entry_form_opened_by_default: Whether or not the new entry form will be automatically opened when viewing an object. - // default: false - 'activity_panel.entry_form_opened_by_default' => false, - - // activity_panel.show_author_name_below_entries: Whether or not to show the author friendlyname next to the date on the last entry. - // default: false - 'activity_panel.show_author_name_below_entries' => false, - - 'allowed_login_types' => 'form|external|basic', - - // apc_cache.enabled: If set, the APC cache is allowed (the PHP extension must also be active) - // default: true - 'apc_cache.enabled' => true, - - // apc_cache.query_ttl: Time to live set in APC for the prepared queries (seconds - 0 means no timeout) - // default: 3600 - 'apc_cache.query_ttl' => 3600, - - // app_root_url: Root URL used for navigating within the application, or from an email to the application (you can put $SERVER_NAME$ as a placeholder for the server's name) - // default: '' - 'app_root_url' => 'http://localhost/itop-dev/', - - // behind_reverse_proxy: If true, then proxies custom header (X-Forwarded-*) are taken into account. Use only if the webserver is not publicly accessible (reachable only by the reverse proxy) - // default: false - 'behind_reverse_proxy' => false, - - // cron_max_execution_time: Duration (seconds) of the page cron.php, must be shorter than php setting max_execution_time and shorter than the web server response timeout - // default: 600 - 'cron_max_execution_time' => 600, - - // csv_file_default_charset: Character set used by default for downloading and uploading data as a CSV file. Warning: it is case sensitive (uppercase is preferable). - // default: 'ISO-8859-1' - 'csv_file_default_charset' => 'ISO-8859-1', - - 'csv_import_charsets' => array(), - - // csv_import_history_display: Display the history tab in the import wizard - // default: false - 'csv_import_history_display' => false, - - // date_and_time_format: Format for date and time display (per language) - // default: array ( - // 'default' => - // array ( - // 'date' => 'Y-m-d', - // 'time' => 'H:i:s', - // 'date_time' => '$date $time', - // ), - // ) - 'date_and_time_format' => array( - 'default' => - array( - 'date' => 'Y-m-d', - 'time' => 'H:i:s', - 'date_time' => '$date $time', - ), - ), - - 'db_host' => 'localhost', - - 'db_name' => 'itop_dev', - - 'db_pwd' => '', - - 'db_subname' => '', - - 'db_user' => 'root', - - // deadline_format: The format used for displaying "deadline" attributes: any string with the following placeholders: $date$, $difference$ - // default: '$difference$' - 'deadline_format' => '$difference$', - - 'default_language' => 'EN US', - - // email_asynchronous: If set, the emails are sent off line, which requires cron.php to be activated. Exception: some features like the email test utility will force the serialized mode - // default: false - 'email_asynchronous' => false, - - // email_default_sender_address: Default address provided in the email from header field. - // default: '' - 'email_default_sender_address' => '', - - // email_default_sender_label: Default label provided in the email from header field. - // default: '' - 'email_default_sender_label' => '', - - // email_transport: Mean to send emails: PHPMail (uses the function mail()) or SMTP (implements the client protocol) - // default: 'PHPMail' - 'email_transport' => 'PHPMail', - - // email_validation_pattern: Regular expression to validate/detect the format of an eMail address - // default: '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}' - 'email_validation_pattern' => '[a-zA-Z0-9._&\'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,}', - - 'encryption_key' => '061c5b88c47ed64664618cf37b91a442b5550704aacecc5f58f96fc98087333b', - - 'encryption_library' => 'OpenSSL', - - 'ext_auth_variable' => '$_SERVER[\'REMOTE_USER\']', - - 'fast_reload_interval' => 60, - - // graphviz_path: Path to the Graphviz "dot" executable for graphing objects lifecycle - // default: '/usr/bin/dot' - 'graphviz_path' => 'C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe', - - // high_cardinality_classes: List of classes with high cardinality (Force manual submit of search) - // default: array ( - // ) - 'high_cardinality_classes' => array(), - - // inline_image_max_display_width: The maximum width (in pixels) when displaying images inside an HTML formatted attribute. Images will be displayed using this this maximum width. - // default: '250' - 'inline_image_max_display_width' => '250', - - // inline_image_max_storage_width: The maximum width (in pixels) when uploading images to be used inside an HTML formatted attribute. Images larger than the given size will be downsampled before storing them in the database. - // default: '1600' - 'inline_image_max_storage_width' => '1600', - - // link_set_attribute_qualifier: Link set from string: attribute qualifier (encloses both the attcode and the value) - // default: '\'' - 'link_set_attribute_qualifier' => '\'', - - // link_set_attribute_separator: Link set from string: attribute separator - // default: ';' - 'link_set_attribute_separator' => ';', - - // link_set_item_separator: Link set from string: line separator - // default: '|' - 'link_set_item_separator' => '|', - - // link_set_value_separator: Link set from string: value separator (between the attcode and the value itself - // default: ':' - 'link_set_value_separator' => ':', - - 'log_global' => true, - - 'log_issue' => true, - - 'log_kpi_duration' => 0, - - 'log_level_min' => array( - '' => LogAPI::LEVEL_WARNING, - 'InlineImage' => LogAPI::LEVEL_TRACE, - 'UserRequest' => LogAPI::LEVEL_TRACE, - ), - - 'log_notification' => true, - - 'log_web_service' => true, - - 'max_display_limit' => 30, - - // max_linkset_output: Maximum number of items shown when getting a list of related items in an email, using the form $this->some_list$. 0 means no limit. - // default: 100 - 'max_linkset_output' => 100, - - // mentions.allowed_classes: Classes which can be mentioned through the autocomplete in the caselogs. Key of the array must be a single character that will trigger the autocomplete, value can be either a DM class or a valid OQL (eg. "@" => "Person", "?" => "SELECT FAQ WHERE status = 'published'") - // default: array ( - // '@' => 'SELECT Person WHERE status = \'active\'', - // ) - 'mentions.allowed_classes' => array( - '@' => 'SELECT Person WHERE status = \'active\'', - ), - - 'min_display_limit' => 20, - - // online_help: Hyperlink to the online-help web page - // default: 'http://www.combodo.com/itop-help' - 'online_help' => 'http://www.combodo.com/itop-help', - - // optimize_requests_for_join_count: Optimize request joins to minimize the count (default is true, try to set it to false in case of performance issues) - // default: true - 'optimize_requests_for_join_count' => true, - - 'password_hash_algo' => '2y', - - // php_path: Path to the php executable in CLI mode - // default: 'php' - 'php_path' => 'php', - - // search_manual_submit: Force manual submit of search all requests - // default: false - 'search_manual_submit' => false, - - 'secure_connection_required' => false, - - // session_name: The name of the cookie used to store the PHP session id - // default: 'iTop' - 'session_name' => 'iTop', - - // shortcut_actions: Actions that are available as direct buttons next to the "Actions" menu - // default: 'UI:Menu:Modify,UI:Menu:New' - 'shortcut_actions' => 'UI:Menu:Modify,UI:Menu:New', - - // source_dir: Source directory for the datamodel files. (which gets compiled to env-production). - // default: '' - 'source_dir' => 'datamodels/2.x/', - - 'standard_reload_interval' => 300, - - // synchro_trace: Synchronization details: none, display, save (includes 'display') - // default: 'none' - 'synchro_trace' => 'none', - - // tag_set_item_separator: Tag set from string: tag label separator - // default: '|' - 'tag_set_item_separator' => '|', - - // timezone: Timezone (reference: http://php.net/manual/en/timezones.php). If empty, it will be left unchanged and MUST be explicitly configured in PHP - // default: 'Europe/Paris' - 'timezone' => 'Europe/Paris', - - // tracking_level_linked_set_default: Default tracking level if not explicitly set at the attribute level, for AttributeLinkedSet (defaults to NONE in case of a fresh install, LIST otherwise - this to preserve backward compatibility while upgrading from a version older than 2.0.3 - see TRAC #936) - // default: 1 - 'tracking_level_linked_set_default' => 0, - - // url_validation_pattern: Regular expression to validate/detect the format of an URL (URL attributes and Wiki formatting for Text attributes) - // default: '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?' - 'url_validation_pattern' => '(https?|ftp)\\://([a-zA-Z0-9+!*(),;?&=\\$_.-]+(\\:[a-zA-Z0-9+!*(),;?&=\\$_.-]+)?@)?([a-zA-Z0-9-.]{3,})(\\:[0-9]{2,5})?(/([a-zA-Z0-9%+\\$_-]\\.?)+)*/?(\\?[a-zA-Z+&\\$_.-][a-zA-Z0-9;:[\\]@&%=+/\\$_.-]*)?(#[a-zA-Z_.-][a-zA-Z0-9+\\$_.-]*)?', -); - -/** - * - * Modules specific settings - * - */ -$MyModuleSettings = array( - 'authent-cas' => array( - 'cas_debug' => false, - 'cas_host' => '', - 'cas_port' => '', - 'cas_context' => '', - 'cas_version' => '', - ), - 'authent-ldap' => array( - 'host' => 'localhost', - 'port' => 389, - 'default_user' => '', - 'default_pwd' => '', - 'base_dn' => 'dc=yourcompany,dc=com', - 'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', - 'options' => array( - 17 => 3, - 8 => 0, - ), - 'start_tls' => false, - 'debug' => false, - ), - 'itop-attachments' => array( - 'allowed_classes' => array( - 0 => 'Ticket', - ), - 'position' => 'relations', - 'preview_max_width' => 290, - 'icon_preview_max_size' => 500000, - ), - 'itop-backup' => array( - 'mysql_bindir' => '', - 'week_days' => 'monday, tuesday, wednesday, thursday, friday', - 'time' => '23:30', - 'retention_count' => 5, - 'enabled' => true, - 'itop_backup_incident' => '', - ), - 'molkobain-console-tooltips' => array( - 'decoration_class' => 'fas fa-question', - 'enabled' => true, - ), - 'itop-time-tracking' => array( - 'allowed_classes' => array( - 'UserRequest' => - array( - 'calendar-tab' => 'SELECT UserRequest WHERE status != "closed"', - 'stopwatch' => 'SELECT UserRequest WHERE status != "closed"', - 'report-tab' => 'SELECT UserRequest WHERE status IN ("resolved", "closed")', - ), - 'Incident' => - array( - 'calendar-tab' => 'SELECT Incident WHERE status != "closed"', - 'stopwatch' => 'SELECT Incident WHERE status != "closed"', - 'report-tab' => 'SELECT Incident WHERE status IN ("resolved", "closed")', - ), - 'CustomerContract' => - array( - 'calendar-page' => 'SELECT CustomerContract WHERE status = "production"', - 'report-tab' => 'SELECT CustomerContract', - ), - ), - 'colors' => array( - 'default_stopwatch' => - array( - 'text' => '#ffffff', - 'background' => '#a6a6a6', - ), - 'default_calendar' => - array( - 'text' => '#ffffff', - 'background' => '#FFCC80', - ), - 'classes' => - array( - 'UserRequest' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:blue', - ), - 'Incident' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:green', - ), - 'CustomerContract' => - array( - 'text' => '#ffffff', - 'background' => 'shadeof:grey', - ), - ), - ), - 'clone_events' => false, - 'default_event_duration' => '00:30:00', - 'day_start_time' => '06:00:00', - 'day_end_time' => '22:00:00', - 'excluded_days' => array( - 0 => 'Saturday', - 1 => 'Sunday', - ), - 'first_day' => 1, - 'business_hours' => array( - 'days_of_week' => - array( - 0 => '1', - 1 => '2', - 2 => '3', - 3 => '4', - 4 => '5', - ), - 'start' => '08:00:00', - 'end' => '18:00:00', - ), - 'minimum_event_duration_display' => '00:30:00', - 'stopwatch_clean_periodicity' => 1, - 'stopwatch_max_time' => 4, - 'delete_max_event_age' => 30, - 'default_report_query' => 'SELECT TimeSpent WHERE contact_id = :contact_id AND start_date >= :start_date AND end_date < :end_date', - 'manager_report_query' => 'SELECT TimeSpent WHERE start_date >= :start_date AND end_date < :end_date', - 'manager_report_silo' => 'SELECT Person', - 'weekly_report_time_spent_attribute' => '', - 'weekly_report_time_spent_default' => '30hrs', - 'report_charts_definition' => array( - 0 => - array( - 'group_by_attribute' => 'contact_id', - 'label' => 'TimeTracking:ReportActivityPerUser', - ), - 1 => - array( - 'group_by_attribute' => 'org_id', - 'label' => 'TimeTracking:ReportActivityPerCustomer', - ), - ), - ), -); - -/** - * - * Data model modules to be loaded. Names are specified as relative paths - * - */ -$MyModules = array( - 'addons' => array( - 'user rights' => 'addons/userrights/userrightsprofile.class.inc.php', - ), -); -?> \ No newline at end of file diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php deleted file mode 100644 index 5c64b2ea2..000000000 --- a/tests/php-unit-tests/unitary-tests/core/ConfigValidator/iTopConfigAstValidatorTest.php +++ /dev/null @@ -1,69 +0,0 @@ -RequireOnceItopFile('env-production/itop-config/src/Validator/iTopConfigAstValidator.php'); - $this->RequireOnceItopFile('env-production/itop-config/src/Validator/ConfigNodesVisitor.php'); - } - - public function testValidateFileValid() - { - try { - $this->CallValidatorOnFile('config-itop_VALID.php'); - } - catch (Exception $e) { - $this->fail('An exception was thrown by the validation method on a valid file: '.$e->getMessage()); - } - - $this->assertTrue(true, 'The file is valid and interpreted as such'); - } - - public function testValidateFileValidLogLevelMinConst() - { - $this->markTestSkipped(' disabled test, is failing for now with error "Invalid configuration: LEVEL_WARNING of type Identifier is forbidden in line 152"'); - try { - $this->CallValidatorOnFile('config-itop_VALID_log-level-min_const.php'); - } - catch (Exception $e) { - $this->fail('An exception was thrown by the validation method on a valid file: '.$e->getMessage()); - } - - $this->assertTrue(true, 'The file is valid and interpreted as such'); - } - - public function testValidateFileWithCode() - { - $this->expectExceptionMessage('type Stmt_Function is forbidden'); - $this->CallValidatorOnFile('config-itop_KO_function.php'); - } - - public function testValidateFileValidWithCodeAtTheEnd() - { - $this->expectExceptionMessage('Stmt_Echo is forbidden'); - $this->CallValidatorOnFile('config-itop_KO_config_plus_code.php'); - } - - /** - * @throws \Exception - */ - private function CallValidatorOnFile(string $sConfigFilePath) - { - $sContents = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.$sConfigFilePath); - - $oiTopConfigValidator = new iTopConfigAstValidator(); - $oiTopConfigValidator->Validate($sContents); - } -} \ No newline at end of file diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php index e49ae24e6..36afd75f0 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/authent-local/UserLocalTest.php @@ -5,7 +5,7 @@ * Time: 09:14 */ -namespace coreExtensions; +namespace Combodo\iTop\Test\UnitTest\Module\AuthentLocal; use Combodo\iTop\Test\UnitTest\ItopDataTestCase; diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigPlaceholdersResolverTest.php similarity index 99% rename from tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigPlaceholdersResolverTest.php index b4e51ea06..e8c17c1cb 100644 --- a/tests/php-unit-tests/unitary-tests/core/ConfigPlaceholdersResolverTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigPlaceholdersResolverTest.php @@ -19,7 +19,7 @@ * */ -namespace Combodo\iTop\Test\UnitTest\Core; +namespace Combodo\iTop\Test\UnitTest\Module\iTopConfig; use Combodo\iTop\Test\UnitTest\ItopTestCase; use ConfigPlaceholdersResolver; diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php similarity index 98% rename from tests/php-unit-tests/unitary-tests/core/ConfigTest.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php index 8ab3febc2..60c72ea48 100644 --- a/tests/php-unit-tests/unitary-tests/core/ConfigTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php @@ -19,7 +19,7 @@ * */ -namespace Combodo\iTop\Test\UnitTest\Core; +namespace Combodo\iTop\Test\UnitTest\Module\iTopConfig; use Combodo\iTop\Test\UnitTest\ItopTestCase; use Config; diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest/config-itop-joker.php similarity index 100% rename from tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-joker.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest/config-itop-joker.php diff --git a/tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest/config-itop-var.php similarity index 100% rename from tests/php-unit-tests/unitary-tests/core/ConfigTest/config-itop-var.php rename to tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest/config-itop-var.php diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php index c94292bee..1d14f1ccc 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigAstValidatorTest.php @@ -5,7 +5,7 @@ * Time: 12:31 */ -namespace Combodo\iTop\Config\Test\Validator; +namespace Combodo\iTop\Test\UnitTest\Module\iTopConfig\Validator; use Combodo\iTop\Config\Validator\iTopConfigAstValidator; use Combodo\iTop\Test\UnitTest\ItopTestCase; @@ -43,7 +43,6 @@ class iTopConfigAstValidatorTest extends ItopTestCase } } - public function InvalidDataProvider() { return array( diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php index fc361a503..b15bcb391 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/Validator/iTopConfigSyntaxValidatorTest.php @@ -5,7 +5,7 @@ * Time: 12:31 */ -namespace Combodo\iTop\Config\Test\Validator; +namespace Combodo\iTop\Test\UnitTest\Module\iTopConfig\Validator; use Combodo\iTop\Config\Validator\iTopConfigAstValidator; use Combodo\iTop\Config\Validator\iTopConfigSyntaxValidator; diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php index 486f1eb55..9af54c08d 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-tickets/itopTicketTest.php @@ -24,7 +24,7 @@ * Time: 13:34 */ -namespace Combodo\iTop\Test\UnitTest\iTopTickets; +namespace Combodo\iTop\Test\UnitTest\Module\iTopTickets; use Combodo\iTop\Test\UnitTest\ItopDataTestCase; use Exception; diff --git a/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php index 390082d16..9506b5a59 100644 --- a/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php @@ -1,6 +1,6 @@ Date: Tue, 10 Jan 2023 23:02:54 +0100 Subject: [PATCH 26/31] =?UTF-8?q?N=C2=B05608=20-=20Harmonize=20namespaces?= =?UTF-8?q?=20and=20merge=20duplicated=20test=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitary-tests/application/SCSSCompilationTest.php | 3 +++ .../unitary-tests/application/Session/SessionTest.php | 2 ++ .../unitary-tests/application/ThemeHandlerTest.php | 4 ++++ .../unitary-tests/core/iTopConfigParserTest.php | 6 ++++++ tests/php-unit-tests/unitary-tests/setup/MFCompilerTest.php | 6 ++++++ .../unitary-tests/sources/Composer/iTopComposerTest.php | 2 ++ .../sources/application/Helper/WebResourcesHelperTest.php | 1 + .../sources/application/RuntimeDashboardTest.php | 4 ++++ .../unitary-tests/sources/application/TestAutoload.php | 2 ++ .../sources/application/TwigBase/Twig/TwigTest.php | 3 ++- 10 files changed, 32 insertions(+), 1 deletion(-) diff --git a/tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php b/tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php index bb47ef516..027a49307 100644 --- a/tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php +++ b/tests/php-unit-tests/unitary-tests/application/SCSSCompilationTest.php @@ -4,7 +4,10 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ +namespace Combodo\iTop\Test\UnitTest\Application; + use Combodo\iTop\Test\UnitTest\ItopTestCase; +use utils; class SCSSCompilationTest extends ItopTestCase { diff --git a/tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php b/tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php index fbc598da6..8d8e31682 100644 --- a/tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php +++ b/tests/php-unit-tests/unitary-tests/application/Session/SessionTest.php @@ -1,5 +1,7 @@ Date: Wed, 11 Jan 2023 10:02:59 +0100 Subject: [PATCH 27/31] :art: :white_check_mark: StatusIncTest : fix phpdoc, replace `@expectedException` --- .../application/status/StatusIncTest.php | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) 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 index c53240572..c09ae0731 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php @@ -1,21 +1,12 @@ InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, [$sConfigFilenamewrong]); } - /** - * - */ public function testStatusCheckConfigFileGood() { $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); @@ -82,10 +70,9 @@ class StatusIncTest extends ItopTestCase { $this->assertTrue(true); } - /** - * @expectedException \MySQLException - */ - public function testStatusStartupWrongDbPwd() { + public function testStatusStartupWrongDbPwd() + { + $this->expectException(MySQLException::class); $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); @@ -93,9 +80,9 @@ class StatusIncTest extends ItopTestCase { $this->RequireOnceItopFile('application/utils.inc.php'); $this->RequireOnceItopFile('core/contexttag.class.inc.php'); - $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); - $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd') . '_unittest'); - $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusStartup", $oStatus, [$oConfigWrong]); + $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); + $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd').'_unittest'); + $this->InvokeNonPublicMethod(Status::class, "StatusStartup", $oStatus, [$oConfigWrong]); } /** From 030f1e24631f0a41ea2c20ed1f602e0301119b89 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 11 Jan 2023 10:28:32 +0100 Subject: [PATCH 28/31] :white_check_mark: Fix Status test --- .../sources/application/status/StatusIncTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 index c09ae0731..92d1dfbbf 100644 --- a/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php +++ b/tests/php-unit-tests/unitary-tests/sources/application/status/StatusIncTest.php @@ -72,17 +72,14 @@ class StatusIncTest extends ItopTestCase { public function testStatusStartupWrongDbPwd() { - $this->expectException(MySQLException::class); - $oStatus = new Status(); - $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); - $this->RequireOnceItopFile('core/cmdbobject.class.inc.php'); $this->RequireOnceItopFile('application/utils.inc.php'); $this->RequireOnceItopFile('core/contexttag.class.inc.php'); $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd').'_unittest'); - $this->InvokeNonPublicMethod(Status::class, "StatusStartup", $oStatus, [$oConfigWrong]); + $this->expectException(MySQLException::class); + new Status($oConfigWrong); } /** From 1271a895d1da6b346056fb8a19cb49c1a5a70e11 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 11 Jan 2023 11:59:01 +0100 Subject: [PATCH 29/31] =?UTF-8?q?N=C2=B05857=20-=20PHPUnit:=20Replace=20us?= =?UTF-8?q?age=20of=20deprecated=20assetContains=20with=20assertStringCont?= =?UTF-8?q?ainsString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php b/tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php index 29af23830..62c7262fd 100644 --- a/tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php +++ b/tests/php-unit-tests/unitary-tests/synchro/DataSynchroTest.php @@ -343,7 +343,7 @@ class DataSynchroTest extends ItopDataTestCase $aKeys = ["creation", "update", "deletion"]; foreach ($aKeys as $sKey){ - $this->assertContains("$sKey errors: 0", $sResultsViewable, "step $iRow : below res should contain '$sKey errors: 0': " . $sResultsViewable); + $this->assertStringContainsString("$sKey errors: 0", $sResultsViewable, "step $iRow : below res should contain '$sKey errors: 0': " . $sResultsViewable); } //N°3805 : potential javascript returned like From 16390c9b003d56d63695b1a8aa93ecfafc696859 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 11 Jan 2023 13:26:54 +0100 Subject: [PATCH 30/31] =?UTF-8?q?N=C2=B05857=20-=20PHPUnit:=20Replace=20us?= =?UTF-8?q?age=20of=20deprecated=20assetContains=20with=20assertStringCont?= =?UTF-8?q?ainsString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitary-tests/core/MetaModelTest.php | 2 +- .../unitary-tests/core/TriggerTest.php | 2 +- .../datamodels/2.x/itop-config/ConfigTest.php | 2 +- .../unitary-tests/webservices/RestTest.php | 26 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php index 3a9b860cc..4e4b0d961 100644 --- a/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php +++ b/tests/php-unit-tests/unitary-tests/core/MetaModelTest.php @@ -334,7 +334,7 @@ class MetaModelTest extends ItopDataTestCase try { MetaModel::GetEnumStyle('Contact', 'name', ''); } catch (CoreException $e) { - self::assertContains('AttributeEnum', $e->getMessage()); + self::assertStringContainsString('AttributeEnum', $e->getMessage()); return; } diff --git a/tests/php-unit-tests/unitary-tests/core/TriggerTest.php b/tests/php-unit-tests/unitary-tests/core/TriggerTest.php index 341dccfbf..333a6082c 100644 --- a/tests/php-unit-tests/unitary-tests/core/TriggerTest.php +++ b/tests/php-unit-tests/unitary-tests/core/TriggerTest.php @@ -60,7 +60,7 @@ class TriggerTest extends ItopDataTestCase $this->assertEquals('Unknown class \'Toto\' (TriggerOnObjectCreate::-1 ()
)', $e1->getMessage()); $fullStackTraceAsString = $e1->getFullStackTraceAsString(); - $this->assertContains("MetaModel::NewObject", $fullStackTraceAsString,"new enriched exception should contain root cause method: " . $fullStackTraceAsString); + $this->assertStringContainsString("MetaModel::NewObject", $fullStackTraceAsString,"new enriched exception should contain root cause method: " . $fullStackTraceAsString); } } diff --git a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php index 367b28a3e..29871f422 100644 --- a/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php +++ b/tests/php-unit-tests/unitary-tests/datamodels/2.x/itop-config/ConfigTest.php @@ -60,7 +60,7 @@ class ConfigTest extends ItopTestCase $this->assertFileExists($sTmpFile); $sFileContent = file_get_contents($sTmpFile); - $this->assertContains($sExpectedContains, $sFileContent, "File content doesn't contain : ".$sExpectedContains); + $this->assertStringContainsString($sExpectedContains, $sFileContent, "File content doesn't contain : ".$sExpectedContains); } public function ProviderPreserveVarOnWriteToFile() diff --git a/tests/php-unit-tests/unitary-tests/webservices/RestTest.php b/tests/php-unit-tests/unitary-tests/webservices/RestTest.php index d71cefa86..37fad99c0 100644 --- a/tests/php-unit-tests/unitary-tests/webservices/RestTest.php +++ b/tests/php-unit-tests/unitary-tests/webservices/RestTest.php @@ -71,14 +71,14 @@ class RestTest extends ItopDataTestCase $aJson = json_decode($sOuputJson, true); if ($this->iJsonDataMode === self::MODE['NO_JSONDATA']){ - $this->assertContains("3", "".$aJson['code'], $sOuputJson); - $this->assertContains("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); + $this->assertStringContainsString("3", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); return; } - $this->assertContains("0", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("0", "".$aJson['code'], $sOuputJson); $sUserRequestKey = $this->array_key_first($aJson['objects']); - $this->assertContains('UserRequest::', $sUserRequestKey); + $this->assertStringContainsString('UserRequest::', $sUserRequestKey); $iId = $aJson['objects'][$sUserRequestKey]['key']; $sExpectedJsonOuput=<<iJsonDataMode === self::MODE['NO_JSONDATA']){ - $this->assertContains("3", "".$aJson['code'], $sOuputJson); - $this->assertContains("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); + $this->assertStringContainsString("3", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); return; } - $this->assertContains("0", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("0", "".$aJson['code'], $sOuputJson); $sUserRequestKey = $this->array_key_first($aJson['objects']); - $this->assertContains('UserRequest::', $sUserRequestKey); + $this->assertStringContainsString('UserRequest::', $sUserRequestKey); $iId = $aJson['objects'][$sUserRequestKey]['key']; //update ticket @@ -164,21 +164,21 @@ JSON; $aJson = json_decode($sOuputJson, true); if ($this->iJsonDataMode === self::MODE['NO_JSONDATA']){ - $this->assertContains("3", "".$aJson['code'], $sOuputJson); - $this->assertContains("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); + $this->assertStringContainsString("3", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("Error: Missing parameter 'json_data'", "".$aJson['message'], $sOuputJson); return; } - $this->assertContains("0", "".$aJson['code'], $sOuputJson); + $this->assertStringContainsString("0", "".$aJson['code'], $sOuputJson); $sUserRequestKey = $this->array_key_first($aJson['objects']); - $this->assertContains('UserRequest::', $sUserRequestKey); + $this->assertStringContainsString('UserRequest::', $sUserRequestKey); $iId = $aJson['objects'][$sUserRequestKey]['key']; //delete ticket $sExpectedJsonOuput=<<assertContains($sExpectedJsonOuput, $this->DeleteTicketFromApi($iId)); + $this->assertStringContainsString($sExpectedJsonOuput, $this->DeleteTicketFromApi($iId)); $sExpectedJsonOuput=<< Date: Wed, 11 Jan 2023 13:41:01 +0100 Subject: [PATCH 31/31] =?UTF-8?q?N=C2=B04660=20-=20Fix=20data=20synchro=20?= =?UTF-8?q?unit=20test=20failure=20due=20to=20another=20test=20not=20resto?= =?UTF-8?q?ring=20correct=20user=20permissions=20on=20conf=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php index 2bb1bd54e..05c1d2e7e 100644 --- a/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php +++ b/tests/php-unit-tests/unitary-tests/core/iTopConfigParserTest.php @@ -46,6 +46,7 @@ class iTopConfigParserTest extends ItopTestCase // restoring config that was in place before the test @chmod($this->sConfigPath, 0770); // RWX for owner and group, nothing for others : else we will have permission denied ! rename($this->tmpSavePath, $this->sConfigPath); + @chmod($this->sConfigPath, 0444); } }