83 Commits

Author SHA1 Message Date
Frédéric FRANCE
7d04067b4e fix CI (Travis) (#35099)
* fix test

* fix test

* fix test

* fix test

* fix test

* fix

* fix

* fix
2025-08-28 02:15:41 +02:00
ldestailleur
3ac25e9581 Fix phpunit 2025-08-17 17:43:20 +02:00
Frédéric FRANCE
e5320c2302 fix phpstan (#31801)
* fix phpstan

* fix phpstan

* fix phpstan

* add phpdoc

* add phpdoc

* add phpdoc

* add phpdoc

* add phpdoc

* add phpdoc
2024-11-13 21:21:15 +01:00
MDW
31584659e0 Refactor objCompare
# Refactor objCompare:

- Move to CommonClassTest;
- Report class name for mismatched property;
- Cope with dolDeprecated property aliases (test may exclude deprecated name,
  also exclude new name).
2024-04-02 11:25:17 +02:00
Laurent Destailleur
f0693549b3 Fix bad message 2024-03-05 01:12:28 +01:00
MDW
e2fba5d03f Qual: FactureTest - use assertions rather than dying in the setup. (#28585)
# Qual: FactureTest - use assertions rather than dying in the setup.

The 'die()' instructions have been replaced - not all tests should fail
because the preconditions for a test case are not met.
2024-03-03 17:08:57 +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
eccff949d6 Mutualize code 2024-02-17 15:34:19 +01:00
Laurent Destailleur
56b0c29d1f Mutualise code 2024-02-16 23:26:32 +01:00
Laurent Destailleur
de7d3c2bf8 Fix with php-cs-fixer 2023-12-04 11:22:28 +01:00
Laurent Destailleur
9a8db612b3 Fix phpunit error 2023-10-17 15:48:38 +02:00
Laurent Destailleur
5dae5b57a0 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2023-05-17 12:27:46 +02:00
Alexandre Janniaux
df0adc391d FIX test/phpunit: add $name to __construct()
Fix the following errors when running recent phpunit:

    Message:  Too few arguments to function PHPUnit\Framework\TestCase::__construct(), 0 passed in
    dolibarr/test/phpunit/DateLibTzFranceTest.php on line 63 and exactly
    1 expected Location: phar:///usr/share/webapps/bin/phpunit.phar/phpunit/Framework/TestCase.php:265

Indeed, the old constructor had an optional $name='' parameter but the
new constructor reads like this:

    public function __construct(string $name)

and the parameter is now mandatory.
2023-05-08 16:29:31 +02:00
Alexandre Janniaux
b6235c29d0 phpunit: use $db instead of $this->savdb
The global variables are stored in $this, and in particular $db is used
through this mean. But $this->savdb is supposed to be the immutable
global state that is stored at the test class instantiation and restored
at the beginning of each test.

For $this->savdb, I don't think any consequences are created by this,
since the object is saved by each test anyway and the $db object is
mostly a query object within a transaction, but future change could use
this to inject a different stateful $db object to trace some behaviour
in the test for instance, so make sure the correct one is used.
2023-04-26 16:44:07 +02:00
Laurent Destailleur
b55271dedb Fix warning 2023-04-15 03:27:35 +02:00
Laurent Destailleur
6c17c2f044 Test travis php7.1 2022-09-21 17:55:04 +02:00
Frédéric France
00da52ef8c fix php8 warnings 2022-08-31 22:12:25 +02:00
Frédéric France
3fdbce7a31 use isModEnabled function 2022-06-11 09:46:28 +02:00
Laurent Destailleur
4da5aeedf4 Fix bad test 2021-05-12 08:42:33 +02:00
Frédéric FRANCE
ae192bf4c9 doxygen 2021-02-10 08:47:22 +01:00
Laurent Destailleur
f301635681 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts:
	htdocs/core/class/html.formmail.class.php
2021-02-03 21:02:32 +01:00
Laurent Destailleur
9ac2dc1a6e Fix phpcs 2021-02-03 20:42:30 +01:00
Frédéric FRANCE
b1a1cd4be6 code syntax 2021-01-14 15:09:08 +01:00
Laurent Destailleur
3d33d3aa3a Fix warning 2020-12-13 14:36:00 +01:00
Laurent Destailleur
100edffdaf Fix phpunit 2020-11-08 16:04:54 +01:00
Laurent Destailleur
a27fc22728 Fix phpunit 2020-10-31 16:53:40 +01:00
Frédéric FRANCE
674b0e38c8 add new rule 2020-05-21 15:13:31 +02:00
Frédéric FRANCE
43dcd9beb5 add new rule 2020-05-21 00:02:33 +02:00
Laurent Destailleur
4d6a45d491 Major doxygen fix 2020-05-03 22:48:35 +02:00
Frédéric FRANCE
7581275316 wip 2019-10-20 11:59:21 +02:00
Alexandre SPANGARO
02dbc11f98 Move Gnu.org to https 2019-09-23 21:55:30 +02:00
Laurent Destailleur
a7390e7e47 Merge pull request #11396 from ATM-Consulting/New_retained_warranty_develop
NEW Management of retained warranty on situation invoices
2019-07-30 21:53:09 +02:00
Laurent Destailleur
3af4ad7fc3 Compatibility with phpunit v6 2019-07-05 21:28:27 +02:00
John Botella
92f6cef00f Fix unit test 2019-07-02 12:07:22 +02:00
Frédéric FRANCE
42a1387218 wip 2019-02-25 00:56:48 +01:00
Frédéric FRANCE
b10558bacd Merge remote-tracking branch 'upstream/develop' into nospaceaftercomma 2019-01-27 23:23:38 +01:00
Frédéric FRANCE
f0cdf300d1 Squiz.Functions.FunctionDeclarationArgumentSpacing 2019-01-27 15:20:16 +01:00
Frédéric FRANCE
24b073771e wip 2019-01-27 13:07:22 +01:00
Maxime Kohlhaas
2e496ea83a QUAL rename facnumber by ref 2018-12-02 17:33:44 +01:00
Frédéric FRANCE
f9a3dec26d Update FactureTest.php 2018-10-20 23:07:08 +02:00
Laurent Destailleur
76d6affb27 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	.travis.yml
2018-09-02 15:46:09 +02:00
Laurent Destailleur
a7dfc88b59 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	test/phpunit/CoreTest.php
2018-09-02 15:21:21 +02:00
Laurent Destailleur
02bedc49d3 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts:
	test/phpunit/PricesTest.php
	test/phpunit/RestAPIUserTest.php
	test/phpunit/WebservicesInvoicesTest.php
2018-09-02 14:15:17 +02:00
Laurent Destailleur
a69c3caf2c Prepare compatibility with phpunit 6.1 2018-09-02 14:10:06 +02:00
Frédéric FRANCE
e2a557aadd limit length of lines to 500 chars 2018-05-27 15:04:12 +02:00
Laurent Destailleur
7811796491 Fix test 2018-04-13 15:43:26 +02:00
Laurent Destailleur
436ec93084 FIX is_erasable report bad value when thirdparty was not loaded 2017-10-04 03:22:41 +02:00
Laurent Destailleur
8794e54eba Try to fix phpunit 2017-10-03 22:52:57 +02:00
Laurent Destailleur
fa6c3eff80 More PHPunit on invoice deletion 2017-09-30 12:53:24 +02:00
Laurent Destailleur
27e0859051 Fix travis error 2016-07-26 13:52:43 +02:00