function simpletest_phpunit_get_available_tests

Get PHPUnit Classes

Parameters

bool $name_only: If TRUE, returns a flat array of class names only.

1 call to simpletest_phpunit_get_available_tests()
SimpletestTestForm::buildForm in drupal/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php
Form constructor.

File

drupal/core/modules/simpletest/simpletest.module, line 715
Provides testing functionality.

Code

function simpletest_phpunit_get_available_tests() {

  // Load the PHPUnit configuration file, which tells us where to find the
  // tests.
  $phpunit_config = simpletest_phpunit_configuration_filepath();
  $configuration = PHPUnit_Util_Configuration::getInstance($phpunit_config);

  // Find all the tests and get a list of unique class names.
  $test_suite = $configuration
    ->getTestSuiteConfiguration(NULL);
  $test_classes = array();
  foreach ($test_suite as $test) {
    $name = get_class($test);
    if (!array_key_exists($name, $test_classes)) {
      $test_classes[$name] = $test
        ->getInfo();
    }
  }
  return $test_classes;
}