Alias "phpunit" to test-pack, remove config when installing v4.1 of phpunit-bridge

This commit is contained in:
Nicolas Grekas
2018-05-23 13:13:06 +02:00
parent 34fc4212d8
commit 1a0f9bd2fd
7 changed files with 73 additions and 2 deletions
+1 -1
View File
@@ -9,5 +9,5 @@
".phpunit",
"/phpunit.xml"
],
"aliases": ["phpunit", "simple-phpunit"]
"aliases": ["simple-phpunit"]
}
+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=');
}
if (false === getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
+12
View File
@@ -0,0 +1,12 @@
{
"copy-from-recipe": {
"bin/": "%BIN_DIR%/",
"phpunit.xml.dist": "phpunit.xml.dist",
"tests/": "tests/"
},
"gitignore": [
".phpunit",
"/phpunit.xml"
],
"aliases": ["simple-phpunit"]
}
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
<env name="KERNEL_CLASS" value="App\Kernel" />
<env name="APP_ENV" value="test" />
<env name="APP_DEBUG" value="1" />
<env name="APP_SECRET" value="s$cretf0rt3st" />
<env name="SHELL_VERBOSITY" value="-1" />
<!-- define your env variables for the test env here -->
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src/</directory>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
@@ -0,0 +1,6 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> How to test? </>
<bg=blue;fg=white> </>
* <fg=blue>Write</> test cases in the <comment>tests/</> folder
* <fg=blue>Run</> <comment>php bin/phpunit</>
+1 -1
View File
@@ -1,3 +1,3 @@
{
"aliases": ["test", "tests"]
"aliases": ["test", "tests", "phpunit"]
}