You are here

function system_test_drupal_get_filename_with_schema_rebuild in Drupal 7

Page callback to run drupal_get_filename() and do a schema rebuild.

1 string reference to 'system_test_drupal_get_filename_with_schema_rebuild'
system_test_menu in modules/simpletest/tests/system_test.module
Implements hook_menu().

File

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

Code

function system_test_drupal_get_filename_with_schema_rebuild() {

  // Prevent SimpleTest from failing as a result of the expected PHP warnings
  // this function causes.
  define('SIMPLETEST_COLLECT_ERRORS', FALSE);

  // Record the original database tables from drupal_get_schema().
  variable_set('system_test_drupal_get_filename_with_schema_rebuild_original_tables', array_keys(drupal_get_schema(NULL, TRUE)));

  // Trigger system_test_schema() and system_test_watchdog() to perform an
  // attempted recursive rebuild when drupal_get_schema() is called. See
  // BootstrapGetFilenameWebTestCase::testRecursiveRebuilds().
  variable_set('system_test_drupal_get_filename_attempt_recursive_rebuild', TRUE);
  drupal_get_schema(NULL, TRUE);
  return '';
}