minor #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 | #16488, #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
This commit is contained in:
Nicolas Grekas 2015-11-09 13:32:25 +01:00
commit 3d41d9368a
2 changed files with 26 additions and 12 deletions

28
phpunit
View File

@ -1,6 +1,18 @@
#!/usr/bin/env php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
// Please update when phpunit needs to be reinstalled with fresh deps:
// Cache-Id-Version: 2015-11-09 12:13 UTC
use Symfony\Component\Process\ProcessUtils;
error_reporting(-1);
@ -10,19 +22,11 @@ require __DIR__.'/src/Symfony/Component/Process/ProcessUtils.php';
$PHPUNIT_VERSION = PHP_VERSION_ID >= 70000 ? '5.0' : '4.8';
$PHPUNIT_DIR = __DIR__.'/.phpunit';
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';
if (!file_exists($COMPOSER = __DIR__.'/composer.phar')) {
$COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : (`which composer.phar` ?: `which composer`));
if (!file_exists($COMPOSER)) {
stream_copy_to_stream(
fopen('https://getcomposer.org/composer.phar', 'rb'),
fopen($COMPOSER = __DIR__.'/composer.phar', 'wb')
);
}
}
$PHP = ProcessUtils::escapeArgument($PHP);
$COMPOSER = $PHP.' '.ProcessUtils::escapeArgument($COMPOSER);
$COMPOSER = file_exists($COMPOSER = __DIR__.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `where.exe composer.phar` : `which composer.phar`))
? $PHP.' '.ProcessUtils::escapeArgument($COMPOSER)
: 'composer';
if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__FILE__) !== @file_get_contents("$PHPUNIT_DIR/.md5")) {
// Build a standalone phpunit without symfony/yaml

View File

@ -24,4 +24,14 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
<arguments>
<array>
<element><string>Symfony\Component\HttpFoundation</string></element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>