Prefer simple-phpunit over direct phpunit deps

This commit is contained in:
Nicolas Grekas
2017-11-24 16:46:23 +01:00
parent 4d7823f876
commit aa3da47614
7 changed files with 34 additions and 2 deletions
+3 -1
View File
@@ -2,5 +2,7 @@
"copy-from-recipe": {
"phpunit.xml.dist": "phpunit.xml.dist"
},
"aliases": ["phpunit"]
"gitignore": [
"/phpunit.xml"
]
}
+4
View File
@@ -21,4 +21,8 @@
<directory>tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
+2
View File
@@ -0,0 +1,2 @@
Adding <comment>phpunit/phpunit</> as a dependency is <comment>discouraged</>.
You should require <fg=green>simple-phpunit</> instead.
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=symfony/yaml');
}
if (false === getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=6.4');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
+2 -1
View File
@@ -1,9 +1,10 @@
{
"copy-from-recipe": {
"bin/": "%BIN_DIR%/",
"phpunit.xml.dist": "phpunit.xml.dist"
},
"gitignore": [
"/phpunit.xml"
],
"aliases": ["simple-phpunit"]
"aliases": ["phpunit", "simple-phpunit"]
}
@@ -21,4 +21,8 @@
<directory>tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
@@ -0,0 +1 @@
Run <comment>php bin/phpunit</> to launch your test suite.