phpunit-pretty-print icon indicating copy to clipboard operation
phpunit-pretty-print copied to clipboard

PrettyPrinterForPhpUnit9 results in exception

Open kec2 opened this issue 3 years ago • 0 comments

Im using:

  • PHP: 8.2
  • PHPUnit: 9.5
  • phpunit-pretty-print: 1.4

installed using Composer.

Not sure of what I'm doing wrong but:

use PHPUnit\TextUI\TestRunner;
use PHPUnit\Framework\TestSuite;

$suite  = new TestSuite('imdbTest');
$testRunner = new TestRunner();
$result = $testRunner->run($suite, ['printer'=>'Sempro\PHPUnitPrettyPrinter\PrettyPrinterForPhpUnit9']);

echo $result->toString();

results in an exception: PHPUnit\Framework\TestResult::addListener(): Argument #1 ($listener) must be of type PHPUnit\Framework\TestListener, null given, called in /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 346

kec2 avatar Jul 23 '22 13:07 kec2