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

Breadcrumb

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

function ResultPrinter::printTestsWithErrors

1 call to ResultPrinter::printTestsWithErrors()
ResultPrinter::print in vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php

File

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

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 printTestsWithErrors(TestResult $result) : void {
    if (!$result->hasTestErroredEvents()) {
        return;
    }
    $elements = [];
    foreach ($result->testErroredEvents() as $event) {
        if ($event instanceof BeforeFirstTestMethodErrored) {
            $title = $event->testClassName();
        }
        else {
            $title = $this->name($event->test());
        }
        $elements[] = [
            'title' => $title,
            'body' => $event->throwable()
                ->asString(),
        ];
    }
    $this->printListHeaderWithNumber(count($elements), 'error');
    $this->printList($elements);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal