public static function PHPUnit_Util_Fileloader::load

Loads a PHP sourcefile.

@since Method available since Release 3.0.0

Parameters

string $filename:

Return value

mixed

1 call to PHPUnit_Util_Fileloader::load()
PHPUnit_Util_Fileloader::checkAndLoad in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php
Checks if a PHP sourcefile is readable. The sourcefile is loaded through the load() method.

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php, line 88

Class

PHPUnit_Util_Fileloader
Utility methods to load PHP sourcefiles.

Code

public static function load($filename) {
  $oldVariableNames = array_keys(get_defined_vars());
  include_once $filename;
  $newVariables = get_defined_vars();
  $newVariableNames = array_diff(array_keys($newVariables), $oldVariableNames);
  foreach ($newVariableNames as $variableName) {
    if ($variableName != 'oldVariableNames') {
      $GLOBALS[$variableName] = $newVariables[$variableName];
    }
  }
  return $filename;
}