Skip to content

Commit 43bdac2

Browse files
author
symfony-flex-server[bot]
authored
Merge pull request #906
2 parents 5fa457c + 1a88b62 commit 43bdac2

File tree

9 files changed

+115
-11
lines changed

9 files changed

+115
-11
lines changed

phpunit/phpunit/4.7/.env.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
KERNEL_CLASS='App\Kernel'
33
APP_SECRET='$ecretf0rt3st'
44
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

phpunit/phpunit/4.7/phpunit.xml.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,18 @@
2424
<directory suffix=".php">src</directory>
2525
</whitelist>
2626
</filter>
27+
28+
<!-- Run `composer require symfony/phpunit-bridge` before enabling this extension -->
29+
<!--
30+
<listeners>
31+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
32+
</listeners>
33+
-->
34+
35+
<!-- Run `composer require symfony/panther` before enabling this extension -->
36+
<!--
37+
<extensions>
38+
<extension class="Symfony\Component\Panther\ServerExtension" />
39+
</extensions>
40+
-->
2741
</phpunit>

phpunit/phpunit/4.7/post-install.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

symfony/phpunit-bridge/5.3/.env.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env php
2+
<?php
3+
if (file_exists(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
4+
require(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit');
5+
} else {
6+
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
7+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
8+
exit(1);
9+
}
10+
11+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
12+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
13+
}
14+
15+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"copy-from-recipe": {
3+
".env.test": ".env.test",
4+
"bin/": "%BIN_DIR%/",
5+
"phpunit.xml.dist": "phpunit.xml.dist",
6+
"tests/": "tests/"
7+
},
8+
"gitignore": [
9+
".phpunit",
10+
".phpunit.result.cache",
11+
"/phpunit.xml"
12+
],
13+
"aliases": ["simple-phpunit"]
14+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
4+
<!-- If you use phpunit-bridge directly, set -->
5+
<!-- xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd" -->
6+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
8+
backupGlobals="false"
9+
colors="true"
10+
bootstrap="tests/bootstrap.php"
11+
>
12+
<php>
13+
<ini name="error_reporting" value="-1" />
14+
<server name="APP_ENV" value="test" force="true" />
15+
<server name="SHELL_VERBOSITY" value="-1" />
16+
<!-- If you use phpunit-bridge directly, you can control extra behavior -->
17+
<!--
18+
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
19+
<server name="SYMFONY_PHPUNIT_VERSION" value="8.5" />
20+
-->
21+
</php>
22+
23+
<testsuites>
24+
<testsuite name="Project Test Suite">
25+
<directory>tests</directory>
26+
</testsuite>
27+
</testsuites>
28+
29+
<filter>
30+
<whitelist processUncoveredFilesFromWhitelist="true">
31+
<directory suffix=".php">src</directory>
32+
</whitelist>
33+
</filter>
34+
35+
<listeners>
36+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
37+
</listeners>
38+
39+
<!-- Run `composer require symfony/panther` before enabling this extension -->
40+
<!--
41+
<extensions>
42+
<extension class="Symfony\Component\Panther\ServerExtension" />
43+
</extensions>
44+
-->
45+
</phpunit>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<bg=blue;fg=white> </>
2+
<bg=blue;fg=white> How to test? </>
3+
<bg=blue;fg=white> </>
4+
5+
* <fg=blue>Write</> test cases in the <comment>tests/</> folder
6+
* Use MakerBundle's <comment>make:test</> command as a shortcut!
7+
* <fg=blue>Run</> the tests with <comment>php bin/phpunit</>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Symfony\Component\Dotenv\Dotenv;
4+
5+
require dirname(__DIR__).'/vendor/autoload.php';
6+
7+
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
8+
require dirname(__DIR__).'/config/bootstrap.php';
9+
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
10+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
11+
}

0 commit comments

Comments
 (0)