Browse files

Actually use the improved error message.

  • Loading branch information...
1 parent f64e76d commit bca41bb0696334a56a76d1b397d2ec2410a06d49 @sebastianbergmann committed Jan 8, 2010
Showing with 4 additions and 10 deletions.
  1. +4 −10 PHPUnit/Util/Fileloader.php
View
14 PHPUnit/Util/Fileloader.php
@@ -80,7 +80,9 @@ public static function checkAndLoad($filename, $syntaxCheck = FALSE)
}
if (!is_readable($filename)) {
- throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'existing file');
+ throw new RuntimeException(
+ sprintf('Cannot open file "%s".' . "\n", $filename)
+ );
}
if ($syntaxCheck) {
@@ -99,19 +101,11 @@ public static function checkAndLoad($filename, $syntaxCheck = FALSE)
*/
public static function load($filename)
{
- $_filename = PHPUnit_Util_Filesystem::fileExistsInIncludePath(
+ $filename = PHPUnit_Util_Filesystem::fileExistsInIncludePath(
$filename
);
- if (!$_filename) {
- throw new RuntimeException(
- sprintf('Cannot open file "%s".' . "\n", $filename)
- );
- }
-
- $filename = $_filename;
$oldVariableNames = array_keys(get_defined_vars());
- unset($_filename);
include_once $filename;

0 comments on commit bca41bb

Please sign in to comment.