PHPUnit and PHP 7 problems

Problem

I’m using PHPUnit 5.5, upgraded my PHP version to 7.2.  Two problems actually occur.  First there’s this weird error:

Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals…

Then figuring PHPUnit needs to be upgraded, I ran

phpunit –self-upgrade

And that failed with the same error.  Changing my PHP version back down to 5.6 and running then causes this error:

internal corruption of phar “…phpunit-temp.phar” (truncated entry)

 

Solution

Unfortunately PHPUnit 5.5 only supports up to version 7.1 and any old version of PHPUnit that has an “old” certificate needs to be downloaded/updated manually.

https://github.com/sebastianbergmann/phpunit/issues/1688

 

Leave a Reply