Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResultPrinter.php

function ResultPrinter::reasonMessage

1 call to ResultPrinter::reasonMessage()
ResultPrinter::mapTestsWithIssuesEventsToElements in vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php
@psalm-param…

File

vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php, line 586

Class

ResultPrinter
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\TextUI\Output\Default

Code

private function reasonMessage(ConsideredRisky|DeprecationTriggered|ErrorTriggered|NoticeTriggered|PhpDeprecationTriggered|PhpNoticeTriggered|PhpunitDeprecationTriggered|PhpunitErrorTriggered|PhpunitWarningTriggered|PhpWarningTriggered|WarningTriggered $reason, bool $single) : string {
    $message = trim($reason->message());
    if ($single) {
        return $message . PHP_EOL;
    }
    $lines = explode(PHP_EOL, $message);
    $buffer = '* ' . $lines[0] . PHP_EOL;
    if (count($lines) > 1) {
        foreach (range(1, count($lines) - 1) as $line) {
            $buffer .= '  ' . $lines[$line] . PHP_EOL;
        }
    }
    return $buffer;
}
RSS feed
Powered by Drupal