public static function PHPUnit_Util_Fileloader::checkAndLoad

Checks if a PHP sourcefile is readable. The sourcefile is loaded through the load() method.

Parameters

string $filename:

Throws

PHPUnit_Framework_Exception

3 calls to PHPUnit_Util_Fileloader::checkAndLoad()
PHPUnit_Framework_TestSuite::addTestFile in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php
Wraps both <code>addTest()</code> and <code>addTestSuite</code> as well as the separate import statements for the user's convenience.
PHPUnit_Runner_StandardTestSuiteLoader::load in drupal/core/vendor/phpunit/phpunit/PHPUnit/Runner/StandardTestSuiteLoader.php
PHPUnit_TextUI_Command::handleBootstrap in drupal/core/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php
Loads a bootstrap file.

File

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

Class

PHPUnit_Util_Fileloader
Utility methods to load PHP sourcefiles.

Code

public static function checkAndLoad($filename) {
  $includePathFilename = stream_resolve_include_path($filename);
  if (!$includePathFilename || !is_readable($includePathFilename)) {
    throw new PHPUnit_Framework_Exception(sprintf('Cannot open file "%s".' . "\n", $filename));
  }
  self::load($includePathFilename);
  return $includePathFilename;
}