Skip to content

Commit

Permalink
Add Recipe for PHPUnit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Sep 11, 2023
1 parent 81880a2 commit e470d73
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
4 changes: 4 additions & 0 deletions phpunit/phpunit/10.0/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
11 changes: 11 additions & 0 deletions phpunit/phpunit/10.0/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"copy-from-recipe": {
".env.test": ".env.test",
"phpunit.dist.xml": "phpunit.dist.xml",
"tests/": "tests/"
},
"gitignore": [
"/phpunit.xml",
"/.phpunit.cache/"
]
}
34 changes: 34 additions & 0 deletions phpunit/phpunit/10.0/phpunit.dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
>
<php>
<ini name="display_errors" value="1" />
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src</directory>
</include>
</source>

<extensions>
</extensions>
</phpunit>
11 changes: 11 additions & 0 deletions phpunit/phpunit/10.0/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
9 changes: 8 additions & 1 deletion symfony/panther/1.0/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
"add-lines": [
{
"file": "phpunit.xml.dist",
"content": " <extension class=\"Symfony\\Component\\Panther\\ServerExtension\" />",
"content": " <bootstrap class=\"Symfony\\Component\\Panther\\ServerExtension\" />",
"position": "after_target",
"target": "<extensions>",
"warn_if_missing": true
},
{
"file": "env.test",
"content": "PANTHER_APP_ENV=panther\nPANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots",
"position": "after_target",
"target": "SYMFONY_DEPRECATIONS_HELPER=999999",
"warn_if_missing": true
}
]
}

0 comments on commit e470d73

Please sign in to comment.