You are here

function system_test_module_implements_alter in Drupal 7

Implements hook_module_implements_alter().

File

modules/simpletest/tests/system_test.module, line 558

Code

function system_test_module_implements_alter(&$implementations, $hook) {

  // For BootstrapGetFilenameWebTestCase::testRecursiveRebuilds() to work
  // correctly, this module's hook_schema() implementation cannot be either the
  // first implementation (since that would trigger a potential recursive
  // rebuild before anything is in the drupal_get_schema() cache) or the last
  // implementation (since that would trigger a potential recursive rebuild
  // after the cache is already complete). So put it somewhere in the middle.
  if ($hook == 'schema') {
    $group = $implementations['system_test'];
    unset($implementations['system_test']);
    $count = count($implementations);
    $implementations = array_merge(array_slice($implementations, 0, $count / 2, TRUE), array(
      'system_test' => $group,
    ), array_slice($implementations, $count / 2, NULL, TRUE));
  }
}