function TestStatus::label
Same name in other branches
- 9 core/lib/Drupal/Core/Test/TestStatus.php \Drupal\Core\Test\TestStatus::label()
- 10 core/lib/Drupal/Core/Test/TestStatus.php \Drupal\Core\Test\TestStatus::label()
- 11.x core/lib/Drupal/Core/Test/TestStatus.php \Drupal\Core\Test\TestStatus::label()
Turns a status code into a human-readable string.
Parameters
int $status: A test runner return code.
Return value
string The human-readable version of the status code.
2 calls to TestStatus::label()
- PhpUnitTestRunner::runTests in core/
lib/ Drupal/ Core/ Test/ PhpUnitTestRunner.php - Executes PHPUnit tests and returns the results of the run.
- PhpUnitTestRunnerTest::testRunTestsError in core/
tests/ Drupal/ Tests/ Core/ Test/ PhpUnitTestRunnerTest.php - Test an error in the test running phase.
File
-
core/
lib/ Drupal/ Core/ Test/ TestStatus.php, line 51
Class
- TestStatus
- Consolidates test result status information.
Namespace
Drupal\Core\TestCode
public static function label($status) {
$statusMap = [
static::PASS => 'pass',
static::FAIL => 'fail',
static::EXCEPTION => 'exception',
static::SYSTEM => 'error',
];
// For status 3 and higher, we want 'error.'
$label = $statusMap[$status > static::SYSTEM ? static::SYSTEM : $status];
return $label;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.