8000 [PhpUnitBridge] Search for SYMFONY_PHPUNIT_REMOVE env var in phpunit.… · symfony/symfony@5e2d43e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e2d43e

Browse files
committed
[PhpUnitBridge] Search for SYMFONY_PHPUNIT_REMOVE env var in phpunit.xml then phpunit.xml.dist
1 parent e973f6f commit 5e2d43e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/Symfony/Bridge/PhpUnit/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.1.0
5+
-----
6+
7+
* Search for `SYMFONY_PHPUNIT_REMOVE` env var in `phpunit.xml` then
8+
`phpunit.xml.dist`
9+
410
4.0.0
511
-----
612

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ $COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rt
5353

5454
if (false === $SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE')) {
5555
$SYMFONY_PHPUNIT_REMOVE = 'phpspec/prophecy symfony/yaml';
56+
57+
$phpunitConfigFilename = null;
58+
if (file_exists('phpunit.xml')) {
59+
$phpunitConfigFilename = 'phpunit.xml';
60+
} elseif (file_exists('phpunit.xml.dist')) {
61+
$phpunitConfigFilename = 'phpunit.xml.dist';
62+
}
63+
if ($phpunitConfigFilename) {
64+
$xml = new DomDocument();
65+
$xml->load($phpunitConfigFilename);
66+
$var = (new DOMXpath($xml))->query('//php/env[@name="SYMFONY_PHPUNIT_REMOVE"]')[0];
67+
if ($var) {
68+
$SYMFONY_PHPUNIT_REMOVE = $var->getAttribute('value');
69+
}
70+
}
5671
}
5772

5873
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__)."\n".$SYMFONY_PHPUNIT_REMOVE !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION.md5")) {

0 commit comments

Comments
 (0)
0