* 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.
# 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).
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.
* 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>
* 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>
Fix the following error when running without the dataset.
Fichinter
✘ Fichinter create
┐
├ ERROR: 23503: insert or update on table "llx_fichinter" violates foreign key constraint "fk_fichinter_fk_soc"
├ DETAIL: Key (fk_soc)=(1) is not present in table "llx_societe".
├ SCHEMA NAME: public
├ TABLE NAME: llx_fichinter
├ CONSTRAINT NAME: fk_fichinter_fk_soc
├ LOCATION: ri_ReportViolation, ri_triggers.c:2596,
├ Failed asserting that 0 is less than -1.
│
│ dolibarr/test/phpunit/FichinterTest.php:147
┴
Adding $localobject->errorsToString() as third argument to the assert
will allow to forward internal errors towards the tests and display them
accordingly.
The testContratCreate() is using the default value for Contrat::socid,
which is defined by Contrat::initAsSpecimen to `0`. But if no companies
have been created, the test will fail with the following error:
Failed asserting that 0 is less than -1.
Or with the additional logging:
UnknownError: ERROR: 23503: insert or update on table "llx_contrat" violates foreign key constraint "fk_contrat_fk_soc"
DETAIL: Key (fk_soc)=(1) is not present in table "llx_societe".
SCHEMA NAME: public
TABLE NAME: llx_contrat
CONSTRAINT NAME: fk_contrat_fk_soc
LOCATION: ri_ReportViolation, ri_triggers.c:2596 -,
Failed asserting that 0 is less than -1.
The test doesn't really depends on specific test data so we can create
the company directly instead.
The testCompanyBankAccountCreate() is using the default value for
CompanyBankAccount::socid, which is defined by
CompanyBankAccount::initAsSpecimen to `0`. But if no companies have been
created, the test will fail with the following error:
Failed asserting that 0 is less than -1.
Or with the additional logging:
ERROR: 23503: insert or update on table "llx_societe_rib" violates foreign key constraint "llx_societe_rib_fk_societe"
DETAIL: Key (fk_soc)=(1) is not present in table "llx_societe".
SCHEMA NAME: public
TABLE NAME: llx_societe_rib
CONSTRAINT NAME: llx_societe_rib_fk_societe
LOCATION: ri_ReportViolation, ri_triggers.c:2596, ERROR: 23503: insert or update on table "llx_societe_rib" violates foreign key constraint "llx_societe_rib_fk_societe"
DETAIL: Key (fk_soc)=(1) is not present in table "llx_societe".
SCHEMA NAME: public
TABLE NAME: llx_societe_rib
CONSTRAINT NAME: llx_societe_rib_fk_societe
LOCATION: ri_ReportViolation, ri_triggers.c:2596
Failed asserting that 0 is less than -1.
The test doesn't really depends on specific test data so we can create
the company directly instead.
The testCommandeCreate() is using the default value for Commande::socid,
which is defined by Command::initAsSpecimen to `0`. But if no companies
have been created, the test will fail with the following error:
Failed asserting that 0 is less than -1.
Or with the additional logging:
ERROR: 23503: insert or update on table "llx_commande" violates foreign key constraint "fk_commande_fk_soc"
DETAIL: Key (fk_soc)=(1) is not present in table "llx_societe".
SCHEMA NAME: public
TABLE NAME: llx_commande
CONSTRAINT NAME: fk_commande_fk_soc
LOCATION: ri_ReportViolation, ri_triggers.c:2596,
Failed asserting that 0 is less than -1.
The test doesn't really depends on specific test data so we can create
the company directly instead.