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

Breadcrumb

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

function 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()
PhpUnitTestRunner::execute in core/lib/Drupal/Core/Test/PhpUnitTestRunner.php
Executes PHPUnit tests and returns the results of the run.

File

core/lib/Drupal/Core/Test/TestStatus.php, line 51

Class

TestStatus
Consolidates test result status information.

Namespace

Drupal\Core\Test

Code

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;
}

API Navigation

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