You are here

public static function PHPUnit_Util_Fileloader::checkAndLoad in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Fileloader.php \PHPUnit_Util_Fileloader::checkAndLoad()

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

Parameters

string $filename:

Return value

string

Throws

PHPUnit_Framework_Exception

3 calls to PHPUnit_Util_Fileloader::checkAndLoad()
PHPUnit_Framework_TestSuite::addTestFile in vendor/phpunit/phpunit/src/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 vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php
PHPUnit_TextUI_Command::handleBootstrap in vendor/phpunit/phpunit/src/TextUI/Command.php
Loads a bootstrap file.

File

vendor/phpunit/phpunit/src/Util/Fileloader.php, line 26

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;
}