HtmlOutputPrinter.php

Same filename in other branches
  1. 8.9.x core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/HtmlOutputPrinter.php
  2. 8.9.x core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/HtmlOutputPrinter.php
  3. 8.9.x core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php
  4. 10 core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php
  5. 11.x core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php

Namespace

Drupal\Tests\Listeners

File

core/tests/Drupal/Tests/Listeners/HtmlOutputPrinter.php

View source
<?php

namespace Drupal\Tests\Listeners;

use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
use PHPUnit\Framework\TestResult;
// In order to manage different implementations across PHPUnit versions, we
// dynamically load the base ResultPrinter class dependent on the PHPUnit runner
// version.
if (!class_exists(ResultPrinterBase::class, FALSE)) {
    if (RunnerVersion::getMajor() < 9) {
        class_alias('PHPUnit\\TextUI\\ResultPrinter', ResultPrinterBase::class);
    }
    else {
        class_alias('PHPUnit\\TextUI\\DefaultResultPrinter', ResultPrinterBase::class);
    }
}

/**
 * Defines a class for providing html output results for functional tests.
 *
 * @internal
 */
class HtmlOutputPrinter extends ResultPrinterBase {
    use HtmlOutputPrinterTrait;
    
    /**
     * {@inheritdoc}
     */
    public function printResult(TestResult $result) : void {
        parent::printResult($result);
        $this->printHtmlOutput();
    }

}

Classes

Title Deprecated Summary
HtmlOutputPrinter Defines a class for providing html output results for functional tests.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.