8000 Merge branch '3.4' · symfony/symfony@01ff6eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 01ff6eb

Browse files
Merge branch '3.4'
* 3.4: [Debug] Fix undefined variable $lightTrace [Bridge/PhpUnit] fix installation path
2 parents e04b4f4 + 79a64d3 commit 01ff6eb

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ if (PHP_VERSION_ID >= 70200) {
2626
$PHPUNIT_VERSION = '4.8';
2727
}
2828

29-
if (file_exists(($path = dirname(__DIR__)).'/composer.json')) {
30-
if (file_exists($path.'/vendor/symfony/phpunit-bridge/composer.json')) {
31-
$path .= '/vendor/symfony/phpunit-bridge';
29+
$root = __DIR__;
30+
while (!file_exists($root.'/composer.json') || file_exists($root.'/bin/simple-phpunit')) {
31+
if ($root === dirname($root)) {
32+
break;
3233
}
33-
} elseif (file_exists($path.'/symfony/phpunit-bridge/composer.json')) {
34-
$path .= '/symfony/phpunit-bridge';
34+
$root = dirname($root);
3535
}
3636

3737
$oldPwd = getcwd();
38-
$PHPUNIT_DIR = getenv('SYMFONY_PHPUNIT_DIR') ?: (dirname(dirname(__DIR__) === $path ? $path : __DIR__).'/.phpunit');
38+
$PHPUNIT_DIR = getenv('SYMFONY_PHPUNIT_DIR') ?: ($root.'/vendor/bin/.phpunit');
3939
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';
4040
$PHP = escapeshellarg($PHP);
4141
if ('phpdbg' === PHP_SAPI) {
@@ -76,9 +76,14 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
7676
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
7777
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
7878
}
79-
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \"*\"");
80-
if (file_exists($path)) {
79+
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
80+
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
8181
passthru("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $path)));
82+
if ('\\' === DIRECTORY_SEPARATOR) {
83+
file_put_contents('composer.json', preg_replace('/^( {8})"phpunit-bridge": \{$/m', "$0\n$1 ".'"options": {"symlink": false},', file_get_contents('composer.json')));
84+
}
85+
} else {
86+
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \"*\"");
8287
}
8388
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
8489
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ public function handleError($type, $message, $file, $line)
403403
$errorAsException = self::$silencedErrorCache[$id][$message];
404404
++$errorAsException->count;
405405
} else {
406+
$lightTrace = array();
406407
$errorAsException = null;
407408
}
408409

0 commit comments

Comments
 (0)
0