2
0
forked from Wavyzz/dolibarr

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.
This commit is contained in:
Alexandre Janniaux
2023-05-07 14:31:35 +02:00
parent 5a3d271829
commit df0adc391d
85 changed files with 253 additions and 170 deletions

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software: you can redistribute it and/or modify
@@ -57,9 +58,9 @@ class MyObjectTest extends PHPUnit\Framework\TestCase
* Constructor
* We save global variables into local variables
*/
public function __construct()
public function __construct($name = '')
{
parent::__construct();
parent::__construct($name);
//$this->sharedFixture
global $conf, $user, $langs, $db;