8000 bug #31210 [PhpUnitBridge] fix reading phpunit.xml on bootstrap (nico… · symfony/symfony@0773baf · GitHub
[go: up one dir, main page]

Skip to content

Commit 0773baf

Browse files
committed
bug #31210 [PhpUnitBridge] fix reading phpunit.xml on bootstrap (nicolas-grekas)
This PR was merged into the 4.2 branch. Discussion ---------- [PhpUnitBridge] fix reading phpunit.xml on bootstrap | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Matches symfony/recipes#561 Commits ------- 1d55f80 [PhpUnitBridge] fix reading phpunit.xml on bootstrap
2 parents e479b69 + 1d55f80 commit 0773baf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ $getEnvVar = function ($name, $default = false) {
3737
}
3838
if (false !== $phpunitConfig) {
3939
$var = new DOMXpath($phpunitConfig);
40+
foreach ($var->query('//php/server[@name="'.$name.'"]') as $var) {
41+
return $var->getAttribute('value');
42+
}
4043
foreach ($var->query('//php/env[@name="'.$name.'"]') as $var) {
4144
return $var->getAttribute('value');
4245
}
@@ -92,7 +95,7 @@ $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rt
9295
: 'composer';
9396

9497

95-
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy symfony/yaml');
98+
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml': ''));
9699

97100
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__)."\n".$SYMFONY_PHPUNIT_REMOVE !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION.md5")) {
98101
// Build a standalone phpunit without symfony/yaml nor prophecy by default

0 commit comments

Comments
 (0)
0