Commit Graph

1892 Commits

Author SHA1 Message Date
MDW
1b4a1510ec Modify module mapping principle (#28511) 2024-02-28 22:47:28 +01:00
MDW
cec3a6c8e8 Qual: Add AbstractRestApiTest class, refactor RestApiUserTest, add RestApiMosTest (#28484)
* New: AbstractRestAPITest class

* Qual: Create RestAPIMosTest
2024-02-28 17:03:53 +01:00
MDW
acd8168cb6 Fix: Fix var_dump checker (#28226)
* Fix: Fix var_dump checker

# Fix: Fix var_dump checker

The core issue was that in PHP whitespace includes newlines by default, the m modifier
is needed to not match multilines.

* Fix: Allow multiple var_dumps on single comment line, refactor

# Fix: Allow multiple var_dumps on single comment line, refactor

Updated the regex to not match a var_dump preceeded with a comment
somewhere on the line.

Refactored var_dump check in dedicated method.

* Qual: Test the test function !

# Qual: Test the test function !

Test that the test function detecting var_dump does detect them.

* Qual: CodingPhpTest - remove comments from file before checking

# Qual: CodingPhpTest - remove comments from file before checking

This helps remove false positives and may have a positive impact on performance.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-25 22:08:07 +01:00
Laurent Destailleur
a3c0c1958e Fix EOL in log 2024-02-24 18:05:42 +01:00
MDW
8842f8ab10 Qual: Refactor CodingPhpTest / CommonClassTest - less verbosity, but better when error (#28388)
* Qual: CommonClassTest - less verbosity, but better when error

# Qual: CommonClassTest - less verbosity, but better when error

- Report the test method and parameters in case of error.
- Less verbosity about setup.
- $_ENV was empty array, replaced with getenv()

* Qual: Refactor CodingPhpTest

# Qual: Refactor CodingPhpTest

- Use dataprovider (better progress report, better errors, better continuation)
- Use dol_dir_list's exclude_filter capability (do not traverse the excluded dirs)
- Reduce debug output from dolibarr.log (not really relevant for these tests).

* Fix: References to loop variables outside loop

# Fix: References to loop variables outside loop

The test referenced some undefined variables outside foreach loops ($val[0])

* Update CommonClassTest.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-24 14:12:32 +01:00
MDW
f3a3de8ea2 Qual: Fix/complete/refactor ModuleTest case. (#28373)
* Fix: Correct CommonClassTest's constructor

# Fix: Correct CommonClassTest's constructor

Dataproviders did not work because of the issue with the constructor

* Qual: Refactor module name list, add mapping to class name

# Qual: Refactor module name list, add mapping to class name

Based on ModuleTest and search for modules in the code, complete the
list of modules and map to the class names.

This will allow reuse in the ModuleTest.

* Qual: Refactor ModulesInit test

# Qual: Refactor ModulesInit test

Use the updated common module mapping list, more complete than
the original list.
Also refactor the test to use a data provider.

* Fix: valid module test must now use array_key_exists

# Fix: valid module test must now use array_key_exists

Because of the introduction of null key values, isset on the array no
longer works, using array_key_exists to test if the modulename is valid.

* fixup! Qual: Refactor module name list, add mapping to class name

* Qual: Less verbosity for tests

# Qual: Less verbosity for tests

The verbosity on setup/teardown/... is not really usefull and
makes the log less readable.  Reducing the verbosity while allowing
to set an environment variable PHPUNIT_DEBUG to enable it.
2024-02-23 17:43:18 +01:00
MDW
f1f516f54c NEW: Global constant for deprecated module mapping (#28348)
* Qual: Add another deprecated module mapping

* NEW: Global constant for deprecated module mapping
2024-02-22 13:23:39 +01:00
MDW
d5d7003f08 Qual: Add test to validate module_names (#28340)
* Qual: Add test to validate module_names

# Qual: Add test to validate module_names

This ensures that all explitly tested module names appear in the reference list.
Displays messages when the module_name is deprecated

* Update CodingPhpTest.php

* Update CodingPhpTest.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-22 02:54:37 +01:00
MDW
af01b3d73a Qual: Re-enable open_basedir restriction in tests (#28315)
* Fix: Workaround for false security issue in tests

# Fix: Workaround for false security issue in tests

This is a quick workaround for the false security issues in tests
by setting the ['SELF'] variable to something that is
considered harmless

* Update windows-ci workflow

# Update windows-ci workflow

- Setup_conf.sh - Added caching feature;
- phpunit.bat - Example updated based on experience with php web server
- Provide dolibarr.log and phpunit output as artefacts.
- Convert PHPUNIT log to Github Annotations
- Setup php web server for API tests
- Enable caching sql initialisation

* Qual: Re-enable open_basedir restriction in tests

# Qual: Re-enable open_basedir restriction in tests

Using open_basedir restriction is closer to the production reality
and seemed to generate some issues on a windows development machine.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-02-21 13:57:05 +01:00
Laurent Destailleur
4acf87f43d Fix warning 2024-02-21 12:46:20 +01:00
Laurent Destailleur
f66b8987ec Sync transifex 2024-02-21 12:40:11 +01:00
Laurent Destailleur
9294662bb5 QUAL Check lang files does not contains 'notranslate' 2024-02-21 12:21:44 +01:00
Laurent Destailleur
7dd9a448cb Fix lang files and add phpunit test to avoid bad < 2024-02-20 22:53:59 +01:00
Laurent Destailleur
02e9ef8023 Close #28293 2024-02-20 14:58:46 +01:00
MDW
db9ce13849 Test/adminlib/remove deprecation (#28302)
* Fix: Deprecation message for backupGlobalsBlackList

# Fix: Deprecation message for backupGlobalsBlackList

Fix the deprecation messages during the tests:

1) AdminLibTest::testVersionCompare
PHPUnit\Framework\TestCase::$backupGlobalsBlacklist is deprecated and will be removed in PHPUnit 10. Please use PHPUnit\Framework\TestCase::$backupGlobalsExcludesList instead.

* Fix: Remove backupGlobalsBlacklist/backupGlobalsExcludesList

# Fix: Remove backupGlobalsBlacklist/backupGlobalsExcludesList

The  backupGlobalsBlacklist/backupGlobalsExcludesList does not seem required
and it is not documented why it is required, so remove this to simplify
the code (see https://github.com/Dolibarr/dolibarr/pull/28292#discussion_r1495116364 ).
2024-02-20 10:38:27 +01:00
MDW
272e8f79c9 Fix: Improve test configuration (#28294)
# Fix: Improve test configuration

## Do not fail early when running tests (stopOnFailure->false)

Finishing the phpunits tests does not require a lot of extra time
so rather than quiting early, run them all.

Also, when needed this option can be enabled on the CLI, but
it can not be disabled.  So when desired, it can still be added
in a ci-flow or local script.

## Improve reporting

We want to report Notices and Warnings and with enough detail to
help during debug.  These options are explicitly activated.
2024-02-20 01:26:25 +01:00
Laurent Destailleur
626edcac77 Add phpunit test on tasks 2024-02-20 01:17:00 +01:00
MDW
afe17928f2 Qual: Improve test messages to help locate errors + php-cs-fixer on tests (#28272)
* Qual: Apply php-cs-fixer before changes

# Qual: Apply php-cs-fixer before changes

Apply php-cs-fixer before changes to make real changes stand out
in next commit.

* Qual: Improve test messages to help locate errors.

# Qual: Improve test messages to help locate errors.

Included a description of the test in the failing assertions to
help locate the error.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: Update spelling exception

# Qual: Update spelling exception

Formatting the code requires an update in the spelling exception list.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.

* Qual: php-cs-fixer on phpunit test file

# Qual: php-cs-fixer on phpunit test file

Apply php-cs-fixer on phpunit test files so that future manual changes
stand out.
2024-02-19 15:28:21 +01:00
Laurent Destailleur
8abe663d6f Add phpunit to test the rename/move into a corrupted pdf file. 2024-02-17 18:59:57 +01:00
Laurent Destailleur
3d98b7b1ac Fix phpunit 2024-02-17 17:38:10 +01:00
Laurent Destailleur
750e3270ac Enhance apstats 2024-02-17 16:46:06 +01:00
Laurent Destailleur
c0a094974a Clean code 2024-02-17 16:03:24 +01:00
Laurent Destailleur
a3b876e5ca Clean code 2024-02-17 15:50:51 +01:00
Laurent Destailleur
eccff949d6 Mutualize code 2024-02-17 15:34:19 +01:00
Laurent Destailleur
671257e8e3 Clean phpunit tests 2024-02-17 15:19:06 +01:00
Laurent Destailleur
4bfbbff447 Remove teardownafter, setup and teardown method in phpunit test 2024-02-17 04:12:42 +01:00
Laurent Destailleur
f9f549ef26 Work on generic filter 2024-02-17 04:07:34 +01:00
Laurent Destailleur
56b0c29d1f Mutualise code 2024-02-16 23:26:32 +01:00
Laurent Destailleur
a32831bc6f Fix regression 2024-02-16 18:18:30 +01:00
Laurent Destailleur
6e8786241c Fix regression 2024-02-16 18:18:17 +01:00
MDW
399f5d6cbe Qual Improve messages in tests (#28193)
* Fix: Improve error messages for AdminLibTest

# Fix: Improve error messages for AdminLibTest

These changes clarify the messages when the changed assertions fail.

* Qual: Improve error messages for FileLibTest

# Qual: Improve error messages for FileLibTest

Certain tests now have error messages that help identify a failing test.
2024-02-16 02:28:32 +01:00
Laurent Destailleur
b48455c9d7 Can remove filter entries 2024-02-16 01:50:03 +01:00
Laurent Destailleur
7107b5feb3 Debug custom report filter management 2024-02-16 01:19:53 +01:00
MDW
43967a83a3 SEC: #28168 Correct protocol limitations (PHP7.4/Win) (#28172)
# SEC: #28168 Correct protocol limitations (PHP7.4/Win)

Protocol limitation was not active during test on windows platform.
Moving the application of the limitation just before the curl_exec
instruction made the limitation effective.

Also extended the code to enable allowing ftp and ftps and extended
the code for [CURLOPT_REDIR_PROTOCOLS_STR](https://www.php.net/manual/en/curl.constants.php#constant.curlopt-redir-protocols-str).
2024-02-15 15:20:21 +01:00
Laurent Destailleur
eedb7e4ec3 Fix warning 2024-02-13 14:05:29 +01:00
Laurent Destailleur
77e836c1b9 Fix remove a test that has no sense 2024-02-11 12:25:21 +01:00
Laurent Destailleur
9abdc1229a Fix test to execute workflow actions. Add more info in trigger errors. 2024-02-10 21:25:26 +01:00
MDW
2e254892ea Qual: Clean up codespell exceptions (#28104)
The files with exceptions can be updated as there are many less cases to
exclude.

In the project files there are a few minor spelling corrections, and
`$scrit` was changed to `$search_crit` to avoid a spelling suggestion.
2024-02-10 17:27:36 +01:00
Laurent Destailleur
1d6cbe1fda Fix GETPOST use should be avoid in classes 2024-02-02 23:46:12 +01:00
Laurent Destailleur
32e205b5d1 Clean code 2024-02-02 19:50:43 +01:00
thibdrev
bb2ca75c46 qual: Update FunctionsLibTest.php - add unit test for roundUpToNextMultiple()
see remarks from PR 27865
2024-01-30 17:49:58 +01:00
thibdrev
ec3687528e qual: Update ProfidLibTest.php - uncomment line testing that BE TIN shall start by 0 or 1
Since PR#27829 has been merged, we can now uncomment the line testing that a the Belgium Tax Identification Number shall start by 0 or 1.
2024-01-28 17:11:12 +01:00
thibdrev
e0b35d2f6b typo 2024-01-27 23:24:01 +01:00
thibdrev
4946184648 phpcs 2024-01-27 14:15:16 +01:00
thibdrev
1d0a6411bc qual: add phpunit tests for profid.lib.php 2024-01-27 14:09:04 +01:00
Laurent Destailleur
e74ed60d0c Try to merge phpstan.neon and phpstan_action.neon 2024-01-14 13:14:52 +01:00
MDW
a04f2bf4e7 Qual: Spelling fixes that newly appeared. (#27495)
* Qual: Spelling fixes that newly appeared.

# Qual: Fix spelling erros that appeared since the bulk updates.

These issues mostly appeared since the bulk updates (a few ones were postponed
to make sure no real spelling errors were missed.)

* Update modulebuilder.lib.php

* Update pdf_standard.modules.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-01-14 12:26:37 +01:00
Laurent Destailleur
8f9d104ccd Fix phpunit 2024-01-13 19:37:06 +01:00
MDW
42a0d05b63 Qual: Spelling outside htdocs (#27448)
* Qual: Spelling outside htdocs

# Qual: Fix spelling of files not in the htdocs subdirectory.

Highlight:
- Change in email test from unvalid to invalid that should give the same test result.

* Update Dolibarr-soapui-project.xml

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-01-12 17:14:13 +01:00
MDW
417726f7b1 Fix: Disable execute bit in git + correct shebangs (#27450)
# Fix: Execute bits in git and shebangs

Some files had the execute bit improperly set to enabled.
Some scripts did not have a correct shebang.
2024-01-12 17:10:16 +01:00