function TestStatus::label
Same name and namespace in other branches
- 11.x 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()
- 9 core/lib/Drupal/Core/Test/TestStatus.php \Drupal\Core\Test\TestStatus::label()
- 8.9.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.
1 call to TestStatus::label()
- PhpUnitTestRunnerTest::testRunTestsError in core/
tests/ Drupal/ Tests/ Core/ Test/ PhpUnitTestRunnerTest.php - Tests 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::ERROR => 'error',
static::SYSTEM => 'exception',
];
// For status 3 and higher, we want 'exception'.
$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.