More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Listeners / HtmlOutputPrinter.php
1 <?php
2
3 namespace Drupal\Tests\Listeners;
4
5 use PHPUnit\Framework\TestResult;
6 use PHPUnit\TextUI\ResultPrinter;
7
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
13   // conditional).
14 }
15 else {
16   /**
17    * Defines a class for providing html output results for functional tests.
18    *
19    * @internal
20    */
21   class HtmlOutputPrinter extends ResultPrinter {
22     use HtmlOutputPrinterTrait;
23     /**
24      * {@inheritdoc}
25      */
26     public function __construct($out = NULL, $verbose = FALSE, $colors = self::COLOR_DEFAULT, $debug = FALSE, $numberOfColumns = 80, $reverse = FALSE) {
27       parent::__construct($out, $verbose, $colors, $debug, $numberOfColumns, $reverse);
28
29       $this->setUpHtmlOutput();
30     }
31
32     /**
33      * {@inheritdoc}
34      */
35     public function printResult(TestResult $result) {
36       parent::printResult($result);
37
38       $this->printHtmlOutput();
39     }
40
41   }
42 }