Skip to content

Commit 3d41d93

Browse files
minor symfony#16503 [ci] Add version tag in phpunit wrapper to trigger cache-reset on demand (nicolas-grekas, emil-nasso)
This PR was merged into the 2.3 branch. Discussion ---------- [ci] Add version tag in phpunit wrapper to trigger cache-reset on demand | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#16488, symfony#16501 | License | MIT | Doc PR | - Commits ------- f93e0c2 [ci] Phpunit tests wont run if composer is installed in a wrapper 481bf66 [ci] Add version tag in phpunit wrapper to trigger cache-reset on demand
2 parents 6d46a18 + f93e0c2 commit 3d41d93

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

phpunit

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
#!/usr/bin/env php
22
<?php
33

4+
/*
5+
* This file is part of the Symfony package.
6+
*
7+
* (c) Fabien Potencier <[email protected]>
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
// Please update when phpunit needs to be reinstalled with fresh deps:
14+
// Cache-Id-Version: 2015-11-09 12:13 UTC
15+
416
use Symfony\Component\Process\ProcessUtils;
517

618
error_reporting(-1);
@@ -10,19 +22,11 @@ require __DIR__.'/src/Symfony/Component/Process/ProcessUtils.php';
1022
$PHPUNIT_VERSION = PHP_VERSION_ID >= 70000 ? '5.0' : '4.8';
1123
$PHPUNIT_DIR = __DIR__.'/.phpunit';
1224
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';
13-
14-
if (!file_exists($COMPOSER = __DIR__.'/composer.phar')) {
15-
$COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : (`which composer.phar` ?: `which composer`));
16-
if (!file_exists($COMPOSER)) {
17-
stream_copy_to_stream(
18-
fopen('https://getcomposer.org/composer.phar', 'rb'),
19-
fopen($COMPOSER = __DIR__.'/composer.phar', 'wb')
20-
);
21-
}
22-
}
23-
2425
$PHP = ProcessUtils::escapeArgument($PHP);
25-
$COMPOSER = $PHP.' '.ProcessUtils::escapeArgument($COMPOSER);
26+
27+
$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : `which composer.phar`))
28+
? $PHP.' '.ProcessUtils::escapeArgument($COMPOSER)
29+
: 'composer';
2630

2731
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5")) {
2832
// Build a standalone phpunit without symfony/yaml

src/Symfony/Component/HttpKernel/phpunit.xml.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@
2424
</exclude>
2525
</whitelist>
2626
</filter>
27+
28+
<listeners>
29+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
30+
<arguments>
31+
<array>
32+
<element><string>Symfony\Component\HttpFoundation</string></element>
33+
</array>
34+
</arguments>
35+
</listener>
36+
</listeners>
2737
</phpunit>

0 commit comments

Comments
 (0)