Commit Graph

431 Commits

Author SHA1 Message Date
odain
4c585614cd ease testing: CreateTestOrganization returns org object 2022-06-08 11:07:31 +02:00
acognet
95dafc87c0 N°4867 - "Twig content not allowed" error when use the extkey widget search icon in the user portal - Add tests 2022-05-30 15:10:50 +02:00
Pierre Goiffon
f9a1f68295 N°4655 Remove OQL tests
Were only here to check legacy OQL engine, but since 2.7.0 we fixed couple of bugs in the current OQL engine : we can't keep same functionalities in both engines :/.

Plus now we are working on 2.7.7 and we're not aware of any use of this legacy engine...

Note that it will be deprecated (N°3141) and removed (N°4715) very soon.
2022-05-24 10:38:59 +02:00
Pierre Goiffon
9b67b0b9d5 Same options in phpunit config files 2022-05-23 14:53:13 +02:00
Pierre Goiffon
da6621f2ff Fix include warning in unittestautoload.php on Windows 2022-05-23 09:53:30 +02:00
Pierre Goiffon
f57d1f1de3 Fix PHPunit errors with InlineImageMock.php and UtilsTest
HTMLDOMSanitizerTest : fix "Fatal error: Cannot declare class InlineImage, because the name is already in use in /var/www/html/iTop/test/core/sanitizer/InlineImageMock.php"
We are now injecting the class to mock, instead of declaring another class with the same name (was working before but why ?!???)

\UtilsTest::testSanitizer : no more testing the "class" filter, because it is a simple indirection, and we need to load datamodel which is causing multiple problems (see the comment in the test method dataprovider)
2022-05-20 10:48:05 +02:00
Benjamin Dalsass
03ef4246bf N°4899 - add sanitizer url since annotation and tests for sanitizer function 2022-05-18 12:03:07 +02:00
Pierre Goiffon
534e7cf59d N°4655 New nightly PHPUnit file containing OQL tests
Those tests were removed in 72af2b7c as they took too much time to run.
We are re-enabling them but only for nightly builds !
2022-05-18 09:35:13 +02:00
Pierre Goiffon
1fb0911710 🔧 N°3091 postbuild PHPunit XML : change html_errors PHP setting 2022-05-03 10:53:32 +02:00
Pierre Goiffon
b348e0ff27 🔧 N°3091 PHPunit XML : change html_errors PHP setting
We are outputting to console, and will get results in Jenkins or terminal, so no HTML please :o)
2022-05-03 10:51:48 +02:00
Pierre Goiffon
c5527c106c 🔧 N°3091 PHPunit XML : set columns 2022-05-02 15:33:39 +02:00
Pierre Goiffon
5eac1b8730 🔧 N°3091 PHPunit XML : fix correct PHP INI settings
see https://phpunit.readthedocs.io/en/8.5/configuration.html#the-php-element
2022-05-02 15:25:59 +02:00
Pierre Goiffon
f4c7afc148 N°4824 Update consumers & tests after nikic/php-parser update
Was done in 3.0.0 with N°3867
(cherry picked from commit cd1ba097cb)
(cherry picked from commit 5b42f67a99)
(cherry picked from commit 2d98ca2318)
(cherry picked from commit ddc5bbd1bb)
2022-04-29 15:24:56 +02:00
Pierre Goiffon
d0ba0d193b N°3091 iTopComposerTest : change deprecated PHPUnit method call 2022-04-22 14:42:12 +02:00
Pierre Goiffon
6e619f2c35 Fix \iTopConfigParserTest::testConfigWriteToFile_FromScratchInstallation throwing error 2022-04-21 12:02:35 +02:00
Pierre Goiffon
163ba41e8d N°3091 Update PHPUnit to 8.5 : remove doesNotPerformAssertions annotation
Modified tests :
- iTopConfigParsertest
- DBSearchIntersectTest::testIntersectOptimization

As expected this isn't working with PHPUnit 8.5
Why does it worked with previous PHPUnit 6 version ? Maybe this annotation wasn't handled yet ? The corresponding PHPUnit doc isn't available anymore...

Annotations doc for PHP 8.5 : https://phpunit.readthedocs.io/en/8.5/annotations.html#doesnotperformassertions
2022-04-21 12:02:35 +02:00
Pierre Goiffon
ec143c43db N°3091 Update PHPUnit to 8.5 : fix setUp and teardDown methods signatures
"Return type declaration must be compatible with parent"
See https://phpunit.de/announcements/phpunit-8.html "Return Type of Template Methods"
2022-04-21 12:02:35 +02:00
Pierre Goiffon
cb39541e2a N°3091 Update PHPUnit to 8.5 : composer and base files
Autoload wasn't working anymore, easy to see : just launch `php unittestautoload.php` (or see fatal errors when launching tests with your IDE)
2022-04-21 10:47:30 +02:00
Pierre Goiffon
11e811cc4b N°3717 Improve iTop object history API (#192)
This fixes a major flaw in the history API that was causing "phantom" CMDBChange records (without any CMDBChangeOp attached). That was happening especially in iProcess impl.
For example this lead to the creation of the combodo-cmdbchange-cleaner module in the Mail To Ticket extension.

The modifications in detail : 
- We can now pass a non persisted CMDBChange instance to \CMDBObject::SetCurrentChange
- No persistence done in \CMDBObject::CreateChange anymore
- Persistence of the attached CMDChange will be done if necessary in CMDBChangeOp::OnInsert
- New CMDBObject::SetCurrentChangeFromParams helper method to ease resetting the current change
2022-04-19 17:13:18 +02:00
Eric Espie
7ce5712b71 N°4967 - 'Previous Values For Updated Attributes' not updated if DBUpdate is called without modifying the object 2022-03-21 08:43:03 +01:00
Pierre Goiffon
f78986009f Improve messages of iTopModuleXmlInstallationChecklistTest::testAllModuleAreIncludedInInstallationXml 2022-03-03 10:46:06 +01:00
Molkobain
4a67819f87 N°4714 - Revert rename of utils::GetItopVersionWikiSyntax as it is used in cached packages in the ITSM Designer 2022-02-11 20:00:39 +01:00
Pierre Goiffon
81c39c35cd N°4771 Fix lib test dir detection
Thanks to @Molkobain and @Hipska for their review in dfaa9733
2022-02-11 18:15:56 +01:00
odain
df1e19dc43 enhance ItopDataTestCase->CreateUser to avoid be able to avoid hardcoded contact_id 2022-02-11 14:10:02 +01:00
Pierre Goiffon
dfaa973359 N°4771 improve iTopComposerTest
- debug testListDeniedTestDir not working well on Windows
- update error message for testAllDirCovered
2022-02-10 12:54:09 +01:00
Pierre Goiffon
299ad7e753 N°4714 Fix \utils::GetCoreVersionWikiSyntax throwing Exception when 2nd version digit is "0" (for example in 3.0.1) 2022-02-08 14:48:02 +01:00
Pierre Goiffon
17612f88d3 N°4714 utils version method refactoring
- removes utils::GetItopPatchVersion and GetItopMinorVersion : unused and badly named :/
- GetItopVersionWikiSyntax now uses core version constant
- iTopModulesPhpVersionIntegrationTest::testiTopModulesPhpVersion now uses ITOP_CORE_VERSION constant
2022-02-01 15:24:56 +01:00
Pierre Goiffon
4e80fc0f76 N°4624 Remove processIsolation flag from postBuild tests
Was done in standard test suite (test/phpunit.xml.dist) with 6bf25f90
2022-02-01 14:50:33 +01:00
Pierre Goiffon
a43adcd202 🔧 phpunit.xml comment OQL better
Was executing on Jenkins :(
2022-01-13 13:11:26 +01:00
Pierre Goiffon
e8e170fb06 🔧 phpunit.xml reorder testSuites again 2022-01-13 13:05:42 +01:00
Pierre Goiffon
5ac5d649aa 🔧 Try again : reorder test suites for better readability
Jenkins should now be fixed
2022-01-13 12:15:12 +01:00
Pierre Goiffon
decb802df4 Revert "🔧 Reorder test suites for better readability"
This reverts commit cacc3a3085.
2022-01-13 09:48:07 +01:00
Pierre Goiffon
cacc3a3085 🔧 Reorder test suites for better readability 2022-01-13 09:42:21 +01:00
Pierre Goiffon
0fd2ea6a47 🎨 phpunit.xml code formatting 2022-01-13 09:42:21 +01:00
Pierre Goiffon
693a861e7d ♻️ Refactor DBBackuptest
Split each test in a dedicated method
2022-01-12 09:42:57 +01:00
Pierre Goiffon
0ee6c60e94 Fix DBBackupTest (again :/)
Was working on Windows but not on Linux...
2022-01-12 09:12:04 +01:00
Pierre Goiffon
a663e9fded Fix DBBackupTest
DB connection dependency was added in a222ead4 (N°2336) in \DBBackup::GetMysqlCliTlsOptions but test wasn't updated accordingly :/^

The test wasn't ran on Jenkins until b11bf308, so we saw the regression only yesterday :(

This is now fixed ! 🥳
2022-01-12 09:00:26 +01:00
Molkobain
c2408b74cd Unit tests: Fix invalid/duplicate class name 2022-01-11 18:13:13 +01:00
Pierre Goiffon
6855c2f83a N°4624 restore backupGlobals to default 2022-01-11 17:29:32 +01:00
Molkobain
b11bf30881 Unit tests: Activate tests that were never ran... 🥶
Note that testGetMysqlCliTlsOptions will fail
2022-01-11 15:49:21 +01:00
Molkobain
64736f1463 Fix unit test provider 2022-01-11 15:48:45 +01:00
Pierre Goiffon
930b224ca2 💡 N°4624 phpdoc for ItopDataTestCase 2022-01-11 15:36:40 +01:00
Pierre Goiffon
e530cbb4f2 N°4624 Restore processIsolation on tests which actually need it
Warning, one symptom was having the CI returning an empty phpunit.results.xml !!
2022-01-07 17:25:18 +01:00
Pierre Goiffon
ddb8378fe6 N°4624 align phpunit annotations
Remove processIsolation when not needed
When needed, make sure to have also their counterpart (preserveGlobalState and backupGlobals)
2022-01-07 15:20:34 +01:00
Pierre Goiffon
47db23d91c 💚 N°4624 Fix other tests after global processIsolation was disabled in 6bf25f90 2022-01-07 12:44:08 +01:00
Pierre Goiffon
fc1f701bf6 💚 N°4624 TransactionsTest : add process isolation
Was global before 6bf25f90
2022-01-07 12:34:09 +01:00
Pierre Goiffon
6bf25f90bc Tests : remove global process isolation
Is done in ItopDataTestCase using annotation
Other tests (like the one extending ItopTestCase) won't use isolation anymore
2021-12-29 15:31:25 +01:00
Pierre Goiffon
e6d61d1ebd Merge remote-tracking branch 'origin/support/2.6' into support/2.7 2021-12-08 17:16:33 +01:00
Pierre Goiffon
f916f9cde8 N°4289 Allow to use privUITransactionFile when no user logged
Before we were throwing a SecurityException, which was blocking for combodo-unauthenticated-form for example
2021-12-08 17:16:12 +01:00
odain-cbd
9addc4a7ca Merge pull request #224 from Combodo/feature/dict-apcu-bug
Feature/dict apcu bug
2021-12-02 12:22:22 +01:00