Mostafa Barmshory
Mostafa Barmshory

Reputation: 2039

PHP Unit testing is not compatible with PHP8, does it support backward compatibility?

I have several test units in PHPUnit and the PHPUnit is not compatible with php8. I`m looking for a way to run old tests on PHP8. Is there any wrapper for PHPUnit to work with PHP8?

By the way, this is the error from the composer install:

    - phpunit/phpunit 9.1.1 requires php ^7.3 -> your PHP version (8.0.1) does not satisfy that requirement.

It may work by removing the requirement from the PHPUnit composer file.

Upvotes: 5

Views: 10435

Answers (1)

Edward Surov
Edward Surov

Reputation: 487

PHPUnit supports PHP 8.0 starting from version 9.3.0. Just upgrade PHPUnit to last version to run your tests.

Upvotes: 17

Related Questions