You are here

protected static function EnvironmentSnapshotMaker::buildSnapshot in X Autoload 7.4

Same name and namespace in other branches
  1. 7.5 lib/Drupal/xautoload/Tests/EnvironmentSnapshotMaker.php \Drupal\xautoload\Tests\EnvironmentSnapshotMaker::buildSnapshot()

Parameters

string[] $classes:

Return value

array

1 call to EnvironmentSnapshotMaker::buildSnapshot()
EnvironmentSnapshotMaker::takeSnapshot in lib/Drupal/xautoload/Tests/EnvironmentSnapshotMaker.php

File

lib/Drupal/xautoload/Tests/EnvironmentSnapshotMaker.php, line 37

Class

EnvironmentSnapshotMaker

Namespace

Drupal\xautoload\Tests

Code

protected static function buildSnapshot($classes) {
  $observations = array();

  // Test that all classes are available immediately at boot time.
  foreach ($classes as $class) {
    $observations['class_exists'][$class] = class_exists($class);
  }

  // Check variable_get().
  $observations['xautoload_cache_types'] = variable_get('xautoload_cache_types');
  $observations['xautoload_cache_lazy'] = variable_get('xautoload_cache_lazy');
  $observations['db_connection_info'] = \Database::getConnectionInfo();
  $spl_autoload_stack = array();
  foreach (spl_autoload_functions() as $callback) {
    $spl_autoload_stack[] = Util::callbackToString($callback);
  }
  $observations['spl_autoload_functions'] = $spl_autoload_stack;
  return $observations;
}