Skip to content

Commit e470d73

Browse files
Add Recipe for PHPUnit 10
1 parent 81880a2 commit e470d73

File tree

5 files changed

+68
-1
lines changed

5 files changed

+68
-1
lines changed

phpunit/phpunit/10.0/.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/10.0/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/10.0/phpunit.dist.xml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
bootstrap="tests/bootstrap.php"
9+
cacheDirectory=".phpunit.cache"
10+
>
11+
<php>
12+
<ini name="display_errors" value="1" />
13+
<ini name="error_reporting" value="-1" />
14+
<server name="APP_ENV" value="test" force="true" />
15+
<server name="SHELL_VERBOSITY" value="-1" />
16+
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
17+
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
18+
</php>
19+
20+
<testsuites>
21+
<testsuite name="Project Test Suite">
22+
<directory>tests</directory>
23+
</testsuite>
24+
</testsuites>
25+
26+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
27+
<include>
28+
<directory>src</directory>
29+
</include>
30+
</source>
31+
32+
<extensions>
33+
</extensions>
34+
</phpunit>
+11
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+
}

symfony/panther/1.0/manifest.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
"add-lines": [
1717
{
1818
"file": "phpunit.xml.dist",
19-
"content": " <extension class=\"Symfony\\Component\\Panther\\ServerExtension\" />",
19+
"content": " <bootstrap class=\"Symfony\\Component\\Panther\\ServerExtension\" />",
2020
"position": "after_target",
2121
"target": "<extensions>",
2222
"warn_if_missing": true
23+
},
24+
{
25+
"file": "env.test",
26+
"content": "PANTHER_APP_ENV=panther\nPANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots",
27+
"position": "after_target",
28+
"target": "SYMFONY_DEPRECATIONS_HELPER=999999",
29+
"warn_if_missing": true
2330
}
2431
]
2532
}

0 commit comments

Comments
 (0)