function HtmlOutputLogger::log

Logs a link to a generated HTML page.

Parameters

string $logEntry: A link to a generated HTML page, should not contain a trailing newline.

Throws

\RuntimeException

1 call to HtmlOutputLogger::log()
BrowserHtmlDebugTrait::htmlOutput in core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php
Logs a HTML output message in a text file.

File

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

Class

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

Namespace

Drupal\TestTools\Extension\HtmlLogging

Code

public static function log(string $logEntry) : void {
    $browserOutputFile = getenv('BROWSERTEST_OUTPUT_FILE');
    if ($browserOutputFile === FALSE) {
        throw new \RuntimeException("HTML output is not enabled");
    }
    file_put_contents($browserOutputFile, $logEntry . "\n", FILE_APPEND);
}

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