Skip to content

Commit

Permalink
- Merge [5437].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 14, 2009
1 parent c166e30 commit 14b91ab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions PHPUnit/Util/Fileloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ public static function checkAndLoad($filename, $syntaxCheck = FALSE)
*/
public static function load($filename)
{
$filename = PHPUnit_Util_Filesystem::fileExistsInIncludePath($filename);
$_filename = PHPUnit_Util_Filesystem::fileExistsInIncludePath(
$filename
);

if (!$filename) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(
1, 'existing file', $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;

Expand Down

0 comments on commit 14b91ab

Please sign in to comment.