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 86

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 {
    if (!self::isEnabled()) {
        throw new \RuntimeException("HTML output is not enabled");
    }
    $browserOutputFile = getenv('BROWSERTEST_OUTPUT_FILE');
    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.