You are here

public function SimpletestPhpunitRunCommandTest::provideStatusCodes in Drupal 8

Data provider for testSimpletestPhpUnitRunCommand().

Return value

array Arrays of status codes and the label they're expected to have.

File

core/modules/simpletest/tests/src/Unit/SimpletestPhpunitRunCommandTest.php, line 85

Class

SimpletestPhpunitRunCommandTest
Tests simpletest_run_phpunit_tests() handles PHPunit fatals correctly.

Namespace

Drupal\Tests\simpletest\Unit

Code

public function provideStatusCodes() {
  $data = [
    [
      0,
      'pass',
    ],
    [
      1,
      'fail',
    ],
    [
      2,
      'exception',
    ],
  ];

  // All status codes 3 and above should be labeled 'error'.
  // @todo: The valid values here would be 3 to 127. But since the test
  // touches the file system a lot, we only have 3, 4, and 127 for speed.
  foreach ([
    3,
    4,
    127,
  ] as $status) {
    $data[] = [
      $status,
      'error',
    ];
  }
  return $data;
}