Skip to content

Commit 0711f89

Browse files
committed
Add PHPUnit 11 recipe
1 parent 52d9ace commit 0711f89

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

phpunit/phpunit/11.1/.env.test

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999

phpunit/phpunit/11.1/manifest.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"copy-from-recipe": {
3+
".env.test": ".env.test",
4+
"phpunit.dist.xml": "phpunit.dist.xml",
5+
"tests/": "tests/"
6+
},
7+
"gitignore": [
8+
"/phpunit.xml",
9+
"/.phpunit.cache/"
10+
]
11+
}

phpunit/phpunit/11.1/phpunit.dist.xml

+45
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+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
backupGlobals="false"
7+
colors="true"
8+
failOnDeprecation="true"
9+
failOnNotice="true"
10+
failOnWarning="true"
11+
bootstrap="tests/bootstrap.php"
12+
cacheDirectory=".phpunit.cache"
13+
>
14+
<php>
15+
<ini name="display_errors" value="1" />
16+
<ini name="error_reporting" value="-1" />
17+
<server name="APP_ENV" value="test" force="true" />
18+
<server name="SHELL_VERBOSITY" value="-1" />
19+
</php>
20+
21+
<testsuites>
22+
<testsuite name="Project Test Suite">
23+
<directory>tests</directory>
24+
</testsuite>
25+
</testsuites>
26+
27+
<source ignoreSuppressionOfDeprecations="true"
28+
ignoreIndirectDeprecations="true"
29+
restrictNotices="true"
30+
restrictWarnings="true"
31+
>
32+
<include>
33+
<directory>src</directory>
34+
</include>
35+
36+
<deprecationTrigger>
37+
<function>trigger_deprecation</function>
38+
<method>Doctrine\Deprecations\Deprecation::trigger</method>
39+
<method>Doctrine\Deprecations\Deprecation::delegateTriggerToBackend</method>
40+
</deprecationTrigger>
41+
</source>
42+
43+
<extensions>
44+
</extensions>
45+
</phpunit>

phpunit/phpunit/11.1/post-install.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* <fg=blue>Write</> test cases in the <comment>tests/</> folder
2+
* Use MakerBundle's <comment>make:test</> command as a shortcut!
3+
* <fg=blue>Run</> the tests with <comment>php bin/phpunit</>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
use Symfony\Component\Dotenv\Dotenv;
4+
5+
require dirname(__DIR__).'/vendor/autoload.php';
6+
7+
if (method_exists(Dotenv::class, 'bootEnv')) {
8+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
9+
}
10+
11+
if ($_SERVER['APP_DEBUG']) {
12+
umask(0000);
13+
}

0 commit comments

Comments
 (0)