Commit Graph

49 Commits

Author SHA1 Message Date
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
Laurent Destailleur
2130be975e Fix perm 2021-05-26 11:01:54 +02:00
Frédéric FRANCE
b1a1cd4be6 code syntax 2021-01-14 15:09:08 +01:00
Laurent Destailleur
4d6a45d491 Major doxygen fix 2020-05-03 22:48:35 +02:00
Alexandre SPANGARO
02dbc11f98 Move Gnu.org to https 2019-09-23 21:55:30 +02:00
Laurent Destailleur
3af4ad7fc3 Compatibility with phpunit v6 2019-07-05 21:28:27 +02:00
Frédéric FRANCE
42a1387218 wip 2019-02-25 00:56:48 +01:00
Frédéric FRANCE
24b073771e wip 2019-01-27 13:07:22 +01:00
Laurent Destailleur
3d3edb19d8 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts:
	.travis.yml
	htdocs/langs/en_US/commercial.lang
2018-09-02 15:48:26 +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
6aee680a4f PSR2 ClassDeclaration 2018-08-29 22:06:05 +02:00
Laurent Destailleur
9523bf5fbd Remove useless code 2017-09-14 10:23:17 +02:00
Laurent Destailleur
4b8862c1ec Remove useless import 2017-09-13 21:54:16 +02:00
Laurent Destailleur
6d40f797d2 Fix regression 2017-09-13 21:50:14 +02:00
Laurent Destailleur
dc38ec5051 Fix regression 2017-09-13 20:48:24 +02:00
Maxime Kohlhaas
add55e8764 new phpunit test for pu calculation from pu_devise 2016-12-11 15:23:55 +01:00
Maxime Kohlhaas
43b402f608 fix phpunit test with new multicurrency return value pu_ht_devise 2016-12-11 15:11:11 +01:00
phf
4baff7898d FIX insert FactureLigne
FIX phpunit PriceTest with new values returned for multicurrency module
NEW add test in PriceTest
FIX FactureTest properties not defined
2016-01-26 22:18:31 +01:00
Raphaël Doursenaud
bbe7498de6 Better Travis CI
NEW:
Cleaned up routines for better readability of both declaration and results.
PHP versions now really covered.
    The old code forced install of PHP and didn't use Travis provided versions.
    This resulted in the process not being executed with the declared PHP version.
Dropped MySQL in favor of MariaDB.
    This is now the FLOSS community standard.
    This should help avoid problems with buggy MySQL releases.
Fast finish enabled to show results faster.
Optimized tools installation with composer.
    The right version of the tool is installed for the PHP version under test.
New PHP linter to check for syntax errors.
    Parallelized for better speed.
Apache + PHP FPM for testing webservices.
    The previous mod_php configuration was not supported on Travis.
New global DEBUG environment variable to show verbose output with configuration files content.
IRC notification on #dolibarr@freenode for community awareness.

FIXES:
Bug in scripts preventing execution with environmentalized PHP.
Wrong detection of MAIN_URL_ROOT under specific circumstances.
    $_SERVER["DOCUMENT_ROOT"] empty and $_SERVER["SCRIPT_NAME"] populated.
Relative ignore directive in coding style ruleset to avoid bypassing test.
Unit test errors without an exit status.
    This prevented the CI from properly detecting and reporting the error.

TODOS:
PostgreSQL support.
    This one is tricky since we only have a MySQL dump and the syntax is not directly compatible.
SQLite support.
    Disabled in core at the moment.
Nginx + PHP FPM support.
    Test webservices on the second most popular webserver.
Run dev/* checks.
    We have a nice collection of scripts we could leverage.
Check Javascript.
Check CSS.
Check SQL.
2015-12-13 21:34:36 +01:00
Laurent Destailleur
7f75a3da9d NEW On list of thirdparties, user can select fields to show.
Make phpunit test working again localy.
Add missing columns into llx_expedition.
2015-10-15 03:29:35 +02:00
Laurent Destailleur
1abcd5f4fe Fix test for vat calculation 2015-04-26 16:58:00 +02:00
Laurent Destailleur
6889162d7a Fix: management of vat type 2, 4 and 6 is now ok.
Works for canada and ivory cost.
2015-04-11 22:51:53 +02:00
Raphaël Doursenaud
f8f502d013 Removed closing php tag
http://php.net/manual/en/language.basic-syntax.phptags.php
2014-05-03 18:18:44 +02:00
Laurent Destailleur
19fb5e5085 Try to fix phpunit error with new version. 2014-05-01 19:57:53 +02:00
Laurent Destailleur
fc96ff31af Fix: phpunit 2013-09-09 02:46:48 +02:00
Laurent Destailleur
7c163f7be3 Fix: Running fixdosfile onto all project 2013-07-07 13:17:48 +02:00
Laurent Destailleur
7b5e0678db New: Make some changes to allow usage of alternative
$dolibarr_main_url_root variables.
Can now use several alternative path. Fix several bugs with all code.
2013-07-07 03:26:51 +02:00
Laurent Destailleur
f1f7ff315f Fix: CRLF 2013-01-16 15:54:07 +01:00
Laurent Destailleur
8d206fdfb0 Prepare move to other licence. For the moment all answers for licence
upgrade were not yet received. So we prepare for GPL by uniformizing
licence text keys to GPL-3+. Will move later to AGPL if all answers are
positive.
2013-01-16 15:36:08 +01:00
Laurent Destailleur
7d5c4a3b38 Fix: Fix upgrade
New: Update dump file
Qual: Add label for PHPUnit tests
2012-11-11 14:34:55 +01:00
Laurent Destailleur
f37c559235 Fix: regression 2012-11-06 19:23:23 +01:00
Laurent Destailleur
058325b7f2 Revert "Fix: avoid phpunit error"
This reverts commit 05b359fbff.
2012-11-06 12:48:58 +01:00
Regis Houssin
05b359fbff Fix: avoid phpunit error 2012-11-04 10:09:03 +01:00
Laurent Destailleur
ef00d592e7 Fix: Backward compatibility with spain. 2012-09-11 01:42:50 +02:00
Laurent Destailleur
e68f861923 New: Add more test and enhancement to make new calcul_price function
more reliable. We need to add more PHPUnit test case on this function
(testcase using localtax1 and localtax2).
2012-09-11 01:09:34 +02:00
Marcos García
5a73c32f46 Migrated ClassName to __construct() function
Changed $DB to $db
lower-cased "Class"
2012-07-30 17:17:33 +02:00
Laurent Destailleur
9b3bab5ff9 Doxygen 2012-02-17 16:02:35 +01:00
Laurent Destailleur
1810189cda Doxygen 2012-02-15 13:41:05 +01:00
Regis Houssin
d45a473d22 Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git
into develop

Conflicts:
	test/phpunit/PricesTest.php
2012-01-12 09:35:46 +01:00
Regis Houssin
d79c9dd17e Fix: add logs 2012-01-12 09:31:45 +01:00
Regis Houssin
84d1ef2a8f Fix: float to string 2012-01-12 09:10:49 +01:00
Laurent Destailleur
a57295cc73 Qual: Add phpunit test before working on different rounding modes 2012-01-11 16:35:12 +01:00
Laurent Destailleur
db77b43f9c Add more phpunit tests 2012-01-11 13:07:02 +01:00