Skip to content

Commit

Permalink
Merge branch '3.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 2, 2012
2 parents 8b4ca87 + 839326a commit b2652e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PHPUnit/Util/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public static function getFilteredStacktrace(Exception $e, $asString = TRUE)
$prefix = FALSE;
$script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);

if (substr($script, -5) == '.phar') {
$prefix = 'phar://' . $script . '/';
if (defined('__PHPUNIT_PHAR__')) {
$prefix = 'phar://' . __PHPUNIT_PHAR__ . '/';
}

if (!defined('PHPUNIT_TESTSUITE')) {
Expand Down
5 changes: 2 additions & 3 deletions PHPUnit/Util/GlobalState.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,9 @@ public static function getIncludedFilesAsString()
$files = get_included_files();
$prefix = FALSE;
$result = '';
$script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);

if (substr($script, -5) == '.phar') {
$prefix = 'phar://' . $script . '/';
if (defined('__PHPUNIT_PHAR__')) {
$prefix = 'phar://' . __PHPUNIT_PHAR__ . '/';
}

for ($i = count($files) - 1; $i > 0; $i--) {
Expand Down
3 changes: 3 additions & 0 deletions build/phar-autoload.php.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env php
<?php
define('__PHPUNIT_PHAR__', realpath($GLOBALS['_SERVER']['SCRIPT_NAME']));

spl_autoload_register(
function ($class)
{
Expand All @@ -19,6 +21,7 @@ spl_autoload_register(
}
);

Phar::mapPhar('___PHAR___');
PHPUnit_TextUI_Command::main();

__HALT_COMPILER();

0 comments on commit b2652e9

Please sign in to comment.