Commit Graph

1892 Commits

Author SHA1 Message Date
Laurent Destailleur
954b127ee0 Fix phpunit 2024-03-24 06:30:18 +01:00
Laurent Destailleur
072c3070b3 Add phpunit for Expedition 2024-03-24 06:23:56 +01:00
Laurent Destailleur
d9488770ae GETPOST(..., 'alpha') does not accept \ char anymore. Replaced with / 2024-03-24 01:45:31 +01:00
Laurent Destailleur
7cbff76f9d Fix phpunit 2024-03-21 14:48:03 +01:00
Laurent Destailleur
2d0e57ce7c Fix test for pgsql 2024-03-21 14:13:17 +01:00
Laurent Destailleur
aa77573cd9 Sanitize DDL instructions 2024-03-21 12:45:58 +01:00
Laurent Destailleur
171c32be34 Add DDLDropTable and DDLCreateTable into phpunit tests 2024-03-21 12:21:38 +01:00
Laurent Destailleur
ae10eedf2a Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-21 11:29:16 +01:00
Laurent Destailleur
57eb393dad Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-21 11:22:28 +01:00
Andrés Maldonado
976686262d FIX: SQL syntax error in DDLUpdateField 2024-03-21 02:36:40 +01:00
MDW
a094ad38fc Fix spelling (using beta codespell)
# Fix spelling (using beta codespell

New spelling fixes - ignoring thirdparty which should be either third-party
or third party.
2024-03-20 00:35:01 +01:00
MDW
f2b7179392 Add test case for numero_semaine 2024-03-18 04:03:50 +01:00
MDW
e5cf5475a1 Qual: Improve test message on failure 2024-03-15 14:20:59 +01:00
MDW
d8a785fa2b FIX get_string_between
# FIX get_string_between

Noticed that the typing of the arguments was incorrect and then found
the implementation suspicious.  The implemented test confirmed that it
was flawed.  Fixed.

Apparently this method is used in get_next_value .
2024-03-13 02:58:59 +01:00
Laurent Destailleur
a6926c29c0 Merge pull request #28778 from fappels/develop_fix_delivery_note
Fix shipping is not a delivery_note (is sub module of shipping)
2024-03-12 14:53:51 +01:00
Francis Appels
75e99a6dee Fix phan tool for shipping 2024-03-12 11:21:42 +01:00
MDW
325cb587f6 Qual: Exclude some tests from windows-ci until fixed
# Qual: Exclude some tests from windows-ci until fixed

Until #28598 and #28264 find some way to the develop branch, this update will
skip the tests that currently fail on windows so that the results of other
tests have an effect on the CI status and github annotations
2024-03-11 20:46:21 +01:00
Laurent Destailleur
1aa1647606 Update SecurityTest.php 2024-03-11 12:53:03 +01:00
Laurent Destailleur
41a57c05c5 Update SecurityTest.php 2024-03-11 12:51:27 +01:00
Laurent Destailleur
29216f3d4e Update CommonClassTest.class.php 2024-03-11 12:49:15 +01:00
Laurent Destailleur
ff0d147847 Merge branch 'develop' into test/security_dol_eval_ob_cleanup_on_exception 2024-03-11 12:48:31 +01:00
Laurent Destailleur
1f4e7aedde Avoid to denaturate value when not required. 2024-03-11 12:47:53 +01:00
MDW
101d56a2c1 Fix: Ob buffer cleanup on exception
# Fix: Ob buffer cleanup on exception

The OB buffer capture was incorrectly cleaned up on exception.
This fixes that.

Also modified the SecurityTest to enable running it standalone
2024-03-10 15:17:58 +01:00
MDW
746ca01423 Fix: Correctly close active output buffer. (#28723)
# Fix: Correctly close active output buffer.

Use ob_get_clean(), not ob_get_contents() and ob_clean().

Tests were failing with:
FunctionsLibTest::testVerifCond with data set "Test that verifConf("0") returns false" ('0', false)
Test code or tested code did not (only) close its own output buffers

OK, but incomplete, skipped, or risky tests\!

Also refactored a test case to use a data provider which helped identify that it was related
to dol_eval.
2024-03-09 01:27:01 +01:00
Laurent Destailleur
f0693549b3 Fix bad message 2024-03-05 01:12:28 +01:00
Laurent Destailleur
41c8c23dbb Disable not complete test 2024-03-05 01:07:19 +01:00
Laurent Destailleur
31ae1bf97f Fix restore stop on failure. No need to continue, we must fix first.
Make travis error analysis easier too.
2024-03-05 01:05:50 +01:00
Laurent Destailleur
d09c9c0174 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-05 00:23:38 +01:00
Laurent Destailleur
ce010a54c7 Clean code and prepare a more powerfull phpunit check for sql forging. 2024-03-05 00:22:12 +01:00
MDW
6f8b941c96 Fix: Script tests on Windows where PHP executable is not in path. (#28565)
# Fix: Script tests (on Windows)

- Set `exit(255)` instead of `exit(-1)` in `scripts/bank/export-bank-receipts.php`.
  On *nix, the -1 converts into an exist code of 255 but on windows it
  is -1, making the test fail.
- Add a helper method to execute php scripts using the php binary used
  to run phpunit.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-04 20:13:34 +01:00
Laurent Destailleur
53e47df053 Use new return code rule 2024-03-04 20:05:18 +01:00
Laurent Destailleur
301bec664a Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-03-03 19:59:34 +01:00
Laurent Destailleur
1e00cf34d4 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2024-03-03 19:50:22 +01:00
Laurent Destailleur
17ff0972ab Fix use of invoke into computed fields 2024-03-03 19:35:37 +01:00
Laurent Destailleur
7b897ae27d Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-03 18:41:49 +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
faf00c35e3 Fix: Skip UtilsTest on windows where ls is not available (#28601)
# Fix: Skip UtilsTest on windows where ls is not available

The test in question uses 'ls' which is not available on windows.
This change limits the execution to non windows systems.
2024-03-03 17:01:17 +01:00
Laurent Destailleur
40f98d529e Fix phpcs 2024-03-03 16:58:03 +01:00
MDW
9c3a375839 Fix: Use accessible temporarypath for CMailFileTest (#28599)
# Fix: Use accessible temporarypath for CMailFileTest

'/tmp' does not exist on all systems and is subject to open_basedir
restrictions.  Selected another temporary path for the test.
2024-03-03 16:56:12 +01:00
MDW
71bb3a1275 Fix: Use accessible path for CategorieTest (#28600)
* Fix: Use accessible path for CategorieTest

# Fix: Use accessible path for CategorieTest

The test was using '/' (root of the filesystem) which was outside
the open_basedir paths.  Modified the path to the medias directory to allow the test to pass with open_basedir restriction in effect.

* Update CategorieTest.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-03-03 15:59:08 +01:00
Laurent Destailleur
21feee3bc8 FIX Better test on validity of compute field syntax with parenthesis 2024-03-03 13:11:54 +01:00
Laurent Destailleur
e12c235185 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-02 16:52:44 +01:00
MDW
9fc7749b96 Qual: Show exception type in error detail on phpunit error (#28576)
# Qual: Show exception type in error detail on phpunit error

Knowing the exception type can be helpful - it's not reported in the
summary.
2024-03-02 16:38:53 +01:00
Frédéric FRANCE
fba15178eb all initAsSpecimen return int (#28577)
* all initAsSpecimen return int

* all initAsSpecimen return int

* all initAsSpecimen return int
2024-03-02 16:38:35 +01:00
Laurent Destailleur
2044a133e9 Fix warning 2024-03-02 13:15:20 +01:00
MDW
2a52a35dc1 Qual: Improve logging on phpunit error by limiting to new log lines (#28575)
# Qual: Improve logging on phpunit error by limiting to new log lines

Log only the new files since the start of the failed test within the limit
of the number of requested lines.

To do this, the log file size is recorded in setUp() to show only the data
beyond this limit on error.
2024-03-02 12:42:20 +01:00
MDW
7e8b45f287 Qual: Improve PhpUnit logging in case of error. (#28562)
# Qual: Improve PhpUnit logging in case of error.

- Log exception message with extra log information.
- Do not output markers for dolibarr.log if no log lines should be shown.
- Use GitHub action style prefixes to group messages
2024-03-01 20:39:52 +01:00
MDW
57f4fc14d8 Fix: phpunit - Add adapter to "not existing directory" assertion (#28534)
# Fix: phpunit - Add adapter to "not existing directory" assertion

This is a helper function added to the common test class which is useful
to maintain cross phpunit version compatibility without triggering a
deprecation error for internal phpunit test functions.

Used in a testcase for dol_dir_move in a pending PR
2024-03-01 12:50:51 +01:00
Laurent Destailleur
b62222c7e4 Fix bad const 2024-02-29 16:51:17 +01:00
MDW
c332251816 Fix: Replace deprecated module names in code strings (#28462)
* Fix: Replace deprecated module names in code strings

# Fix: Replace deprecated module names in code strings

A few cases that slipped through the manual replacements

* Qual: Enable deprecation notices in CodingPhpTest for isModEnabled

# Qual: Enable deprecation notices in CodingPhpTest for isModEnabled

As all detections are now fixed, we can enable the deprecation notice
trigger in the CodingPhpTest.
2024-02-28 23:01:01 +01:00