# Update phpunit.bat sample script and setup_conf.sh
- setup_conf.sh - Added caching feature;
- phpunit.bat - Example updated based on experience with php web server
# Qual: Optimisation in load criteria (dol_dir_list)
By moving the "$sortcriteria" conditions into the load conditions, the
comparison between strings is less frequent.
The original test can probably even be removed as it is part of load_*.
The only side-effect that I can see is with the hook, but I think
in theory there should not be a negative side-effect, only a positive
one as this tells the hook to load the data we need without relying
on the hook to make the proper interpretation of the searchcriteria.
* qual: phpstan for htdocs/salaries/class/paymentsalary.class.php
htdocs/salaries/class/paymentsalary.class.php 205 Property PaymentSalary::$amount (float) does not accept string.
htdocs/salaries/class/paymentsalary.class.php 292 Property PaymentSalary::$amount (float) does not accept string.
htdocs/salaries/class/paymentsalary.class.php 389 Property PaymentSalary::$amount (float) does not accept string.
htdocs/salaries/class/paymentsalary.class.php 565 Property PaymentSalary::$datec (int) does not accept string.
* Update paymentsalary.class.php - apply price2num() on $totalamount before testing if $totalamount==0
* typo
# Fix: Do not use exit in Testcase environment
Let tests continue in test case environment and allow identifying
the cause for what would be an exit in a production setup.
* 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 ).
* Qual: Refactor for distinction between encodings
# Qual: Refactor for distinction between encodings
Renamed path/file variable to equivalents with prefix os_ and utf8.
Also added $utf8_fullpath to optimize.
* Fix: Fix mixed os_path/utf8_path
# Fix: Fix mixed os_path/utf8_path
This fixes the mixing of a os_path encoding en utf8_path encoding
by reorganising the statement order.
Also avoid a os_encode call by reusing data already available.
* qual : phpstan for htdocs/core/class/dolgraph.class.php
htdocs/core/class/dolgraph.class.php 703 Method DolGraph::GetCeilMaxValue() should return int but returns float.
htdocs/core/class/dolgraph.class.php 1551 Method DolGraph::total() should return string but returns (float|int).
htdocs/core/class/dolgraph.class.php 1593 Method DolGraph::getDefaultGraphSizeForStats() should return int but returns string.
htdocs/core/class/dolgraph.class.php 1599 Method DolGraph::getDefaultGraphSizeForStats() should return int but returns string.
* phpcs
htdocs/product/class/propalmergepdfproduct.class.php 313 Property Propalmergepdfproduct::$fk_product (int) does not accept string.
htdocs/product/class/propalmergepdfproduct.class.php 319 Property Propalmergepdfproduct::$fk_user_mod (int) does not accept string.
htdocs/fourn/class/api_supplier_invoices.class.php 474 Property Paiement::$datepaye (int) does not accept string.
htdocs/fourn/class/api_supplier_invoices.class.php 475 Property Paiement::$amounts (array<int, float>) does not accept array<int, string>.
htdocs/fourn/class/api_supplier_invoices.class.php 476 Property Paiement::$multicurrency_amounts (array<int, float>) does not accept arra
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
# 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.