3 namespace Drupal\Core\Test;
6 * Consolidates test result status information.
8 * For our test runners, a $status of 0 = passed test, 1 = failed test,
9 * 2 = exception, >2 indicates segfault timeout, or other type of system
15 * Signify that the test result was a passed test.
20 * Signify that the test result was a failed test.
25 * Signify that the test result was an exception or code error.
27 * This means that the test runner was able to exit and report an error.
32 * Signify a system error where the test runner was unable to complete.
34 * Note that SYSTEM actually represents the lowest value of system errors, and
35 * the returned value could be as high as 127. Since that's the case, this
36 * constant should be used for range comparisons, and not just for equality.
38 * @see http://php.net/manual/en/pcntl.constants.php
43 * Turns a status code into a human-readable string.
46 * A test runner return code.
49 * The human-readable version of the status code.
51 public static function label($status) {
53 static::PASS => 'pass',
54 static::FAIL => 'fail',
55 static::EXCEPTION => 'exception',
56 static::SYSTEM => 'error',
58 // For status 3 and higher, we want 'error.'
59 $label = $statusMap[$status > static::SYSTEM ? static::SYSTEM : $status];