You are here

protected function CoderUpgradeUnitTestCase::captureThemeInfo in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/coder_upgrade.test \CoderUpgradeUnitTestCase::captureThemeInfo()

Stores the theme registry for core modules and the modules being upgraded.

1 call to CoderUpgradeUnitTestCase::captureThemeInfo()
CoderUpgradeUnitTestCase::setUp in coder_upgrade/coder_upgrade.test
Sets up unit test environment.

File

coder_upgrade/coder_upgrade.test, line 75

Class

CoderUpgradeUnitTestCase
Unit tests for the upgrade routines.

Code

protected function captureThemeInfo() {
  if (variable_get('coder_upgrade_replace_files', FALSE)) {
    return;
  }

  // Include necessary files.
  $module_dirname = DRUPAL_ROOT . '/' . drupal_get_path('module', 'grammar_parser');
  require_once $module_dirname . '/engine/grammar_parser.parser.inc';
  require_once $module_dirname . '/engine/grammar_parser.reader.inc';

  // TODO Move the debug_print method to .inc file??? Then avoid this load at this time.
  $module_dirname = DRUPAL_ROOT . '/' . drupal_get_path('module', 'coder_upgrade');
  require_once $module_dirname . '/includes/main.inc';
  require_once $module_dirname . '/conversions/begin.inc';
  require_once $module_dirname . '/conversions/function.inc';
  coder_upgrade_debug_print("module = {$module_dirname}");
  coder_upgrade_path_clear('memory');
  coder_upgrade_memory_print('load code');
  $in_dirname = $module_dirname . '/tests/old/';
  $out_dirname = DRUPAL_ROOT . '/' . coder_upgrade_directory_path('new');
  $directories = array(
    $this->test_directory => 1,
  );
  foreach ($directories as $key => $directory) {
    $items[] = array(
      'name' => $key,
      'old_dir' => $in_dirname . $key,
      'new_dir' => $out_dirname . $key,
    );
  }

  // Build theme registry cache.
  coder_upgrade_upgrade_begin_alter($items[0]);
}