function HtmlOutputLogger::testRunnerFinished

Prints the list of HTML output generated during the test.

File

core/tests/Drupal/TestTools/Extension/HtmlLogging/HtmlOutputLogger.php, line 135

Class

HtmlOutputLogger
Drupal's extension for providing HTML output results for functional tests.

Namespace

Drupal\TestTools\Extension\HtmlLogging

Code

public function testRunnerFinished(TestRunnerFinished $event) : void {
    if (!$this->enabled) {
        throw new \RuntimeException("HTML output is not enabled");
    }
    $contents = file_get_contents($this->browserOutputFile);
    if ($contents) {
        print "\n\n";
        if ($this->outputVerbose) {
            print "HTML output was generated.\n";
            print $contents;
        }
        else {
            print "HTML output was generated, " . count(explode("\n", $contents)) . " page(s).\n";
        }
    }
    // No need to keep the file around any more.
    unlink($this->browserOutputFile);
    putenv('BROWSERTEST_OUTPUT_FILE');
    $this->browserOutputFile = NULL;
}

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