Skip to content

Commit 31f2e3c

Browse files
[PhpUnitBridge] fix reading phpunit.xml on bootstrap
1 parent 12593ad commit 31f2e3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)