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

Breadcrumb

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

function TestSuite::throwableToString

Throws

Exception

1 call to TestSuite::throwableToString()
TestSuite::addTestMethod in vendor/phpunit/phpunit/src/Framework/TestSuite.php

File

vendor/phpunit/phpunit/src/Framework/TestSuite.php, line 577

Class

TestSuite
@template-implements IteratorAggregate<int, Test>

Namespace

PHPUnit\Framework

Code

private function throwableToString(Throwable $t) : string {
    $message = $t->getMessage();
    if (empty(trim($message))) {
        $message = '<no message>';
    }
    if ($t instanceof InvalidDataProviderException) {
        return sprintf("%s\n%s", $message, Filter::getFilteredStacktrace($t));
    }
    return sprintf("%s: %s\n%s", $t::class, $message, Filter::getFilteredStacktrace($t));
}
RSS feed
Powered by Drupal