3 namespace Drupal\Tests\Listeners;
5 use PHPUnit\Framework\TestResult;
6 use PHPUnit\TextUI\ResultPrinter;
8 if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
9 class_alias('Drupal\Tests\Listeners\Legacy\HtmlOutputPrinter', 'Drupal\Tests\Listeners\HtmlOutputPrinter');
10 // Using an early return instead of a else does not work when using the
11 // PHPUnit phar due to some weird PHP behavior (the class gets defined without
12 // executing the code before it and so the definition is not properly
17 * Defines a class for providing html output results for functional tests.
21 class HtmlOutputPrinter extends ResultPrinter {
22 use HtmlOutputPrinterTrait;
27 public function __construct($out = NULL, $verbose = FALSE, $colors = self::COLOR_DEFAULT, $debug = FALSE, $numberOfColumns = 80, $reverse = FALSE) {
28 parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
30 $this->setUpHtmlOutput();
36 public function printResult(TestResult $result) {
37 parent::printResult($result);
39 $this->printHtmlOutput();