oradwell/covers-validator

Error with PHPUnit 7.x

JeroenDeDauw opened this issue · 4 comments

Even though the CI here passes with PHPUNit 7.x, in my project I get an error when I use covers-validator with 7.x instead of 6.x:

CoversValidator 0.7.0

Fatal error: Uncaught Error: Class 'PHPUnit\Util\Fileloader' not found in /app/vendor/ockcyp/covers-validator/src/Loader/FileLoader.php:16
Stack trace:
#0 /app/vendor/ockcyp/covers-validator/src/Handler/InputHandler.php(31): OckCyp\CoversValidator\Loader\FileLoader::loadFile('/app/tests/boot...')
#1 /app/vendor/ockcyp/covers-validator/src/Command/ValidateCommand.php(52): OckCyp\CoversValidator\Handler\InputHandler::handleInput(Object(Symfony\Component\Console\Input\ArgvInput))
#2 /app/vendor/symfony/console/Command/Command.php(252): OckCyp\CoversValidator\Command\ValidateCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /app/vendor/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OckCyp\CoversVal in /app/vendor/ockcyp/covers-validator/src/Loader/FileLoader.php on line 16

are you using the phar build?

No. Both covers-validator and PHPUnit are pulled in via composer by listing in require-dev

it seems the class name is wrong for PHPUnit 7.x (PHPUnit\Util\Fileloader: they made the L uppercase in 7.x). I think we should still be able to support both using class_exists. Would you be able to test and create a PR?

use PHPUnit\Util\Fileloader as PHPUnitFileloader;

Ah, indeed! That fixes it :)

#22