This issue concerns Drupal 9 compatibility fixes to upgrade this module to Drupal 9

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bachir.benbahloul created an issue. See original summary.

sinn’s picture

datetime_testing tests failed in PHPUnit 9 (that is used in Drupal 9) because time is printed differently because of PHPUnit\Framework\Assert::assertEquals() function parameters have been changed in this version.

The optional $delta parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsWithDelta() instead.

PHPUnit <=8 : https://github.com/sebastianbergmann/phpunit/blob/8.5.15/src/Framework/Assert.php#L601

public static function assertEquals($expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void

PHPUnit 9 https://github.com/sebastianbergmann/phpunit/blob/9.5/src/Framework/Asse...

public static function assertEquals($expected, $actual, string $message = ''): void

Instead of assertEquals() function assertEqualsWithDelta() should be used, but it appeared in PHPUnit 7.5.0. So I would suggest to set it as minimum version in require-dev in composer and replace assertEquals() by assertEqualsWithDelta().

Also in the tests please fix:

Return type declaration must be compatible with TestCase->tearDown() : void
Return type declaration must be compatible with TestCase->setUp() : void

sinn’s picture

Status: Active » Needs review
StatusFileSize
new9.44 KB

Let's try patch

ademarco’s picture

Status: Needs review » Fixed

I've merged the MR. Closing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.