You are here

function simpletest_registry_files_alter in Drupal 7

Implements hook_registry_files_alter().

Add the test files for disabled modules so that we get a list containing all the avialable tests.

File

modules/simpletest/simpletest.module, line 497
Provides testing functionality.

Code

function simpletest_registry_files_alter(&$files, $modules) {
  foreach ($modules as $module) {

    // Only add test files for disabled modules, as enabled modules should
    // already include any test files they provide.
    if (!$module->status) {
      $dir = $module->dir;
      if (!empty($module->info['files'])) {
        foreach ($module->info['files'] as $file) {
          if (substr($file, -5) == '.test') {
            $files["{$dir}/{$file}"] = array(
              'module' => $module->name,
              'weight' => $module->weight,
            );
          }
        }
      }
    }
  }
}