[dev] PHPUnit 9.5 compat

Jan Schneider jan at horde.org
Sun Mar 28 11:15:34 UTC 2021


Zitat von Ralf Lang <lang at b1-systems.de>:

> Hello,
>
> Am 02.03.21 um 21:07 schrieb Ralf Lang:
>> Hello,
>>
>> I added some changes to make Horde_Test compatible with phpunit 9.5.
>>
>> This will not magically make all test suites run though.
>>
> I have fixed a minor glitch in Horde_Test_Functional breaking Horde_View
> unit tests in phpunit 9.5.
>
> A colleague and I began converting some library unit tests to phpunit 9.
>
> This meant
>
> - Namespacing unit tests, test base classes, mocks and test helpers.
> - Sometimes changing assert methods or method signatures to newer standards
> - amending risky assertion-less tests to tests containing assertions.
> - turning try/catch blocks into expectException.
> - turning unconditional requires into conditional requires.
> - other upgrade work
>
> While parts of it could be semi-automated using the rector tool, most is
> manual work.
>
> Next in line should be building a horde-components qc runner github
> action which can run on push or PR. And of course, converting all the
> remaining tests.

Regarding the different PHPUnit versions that have different  
compatibility with the PHP versons we support, I have played a bit  
with dependencies and different major versions in the past:

https://github.com/yunosh/phpunit-1 contains several major versions  
with different dependencies on PHP and PHPUnit. This would be  
Horde_Test.
https://github.com/yunosh/phpunit-2 would be the library that depends  
on Horde_Test aka phpunit-1. Composer can resolve this to the correct  
PHPUnit version, depending on the PHP version that is currently  
installed.

Since this is a bit older, 9.5. didn't exist at this point, but maybe  
it could be extended to match this.

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the dev mailing list