From 12d560b51bfccb1d472a42b95ee006f3a40a2ae4 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Fri, 7 Mar 2025 09:37:31 +0100 Subject: [PATCH] Add Recipe for PHPUnit 10 (#1239) * Add Recipe for PHPUnit 10 * Reapply suggestions * Remove bridge to Symfony 4.4 bootstrap file --- phpunit/phpunit/10.0/.env.test | 4 +++ phpunit/phpunit/10.0/manifest.json | 11 ++++++++ phpunit/phpunit/10.0/phpunit.dist.xml | 34 ++++++++++++++++++++++++ phpunit/phpunit/10.0/tests/bootstrap.php | 9 +++++++ phpunit/phpunit/4.7/tests/bootstrap.php | 4 +-- phpunit/phpunit/9.3/tests/bootstrap.php | 4 +-- phpunit/phpunit/9.6/tests/bootstrap.php | 4 +-- symfony/panther/1.0/manifest.json | 14 ++++++++++ 8 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 phpunit/phpunit/10.0/.env.test create mode 100644 phpunit/phpunit/10.0/manifest.json create mode 100644 phpunit/phpunit/10.0/phpunit.dist.xml create mode 100644 phpunit/phpunit/10.0/tests/bootstrap.php diff --git a/phpunit/phpunit/10.0/.env.test b/phpunit/phpunit/10.0/.env.test new file mode 100644 index 00000000..24a43c03 --- /dev/null +++ b/phpunit/phpunit/10.0/.env.test @@ -0,0 +1,4 @@ +# define your env variables for the test env here +KERNEL_CLASS='App\Kernel' +APP_SECRET='$ecretf0rt3st' +SYMFONY_DEPRECATIONS_HELPER=999999 diff --git a/phpunit/phpunit/10.0/manifest.json b/phpunit/phpunit/10.0/manifest.json new file mode 100644 index 00000000..a35670ab --- /dev/null +++ b/phpunit/phpunit/10.0/manifest.json @@ -0,0 +1,11 @@ +{ + "copy-from-recipe": { + ".env.test": ".env.test", + "phpunit.dist.xml": "phpunit.dist.xml", + "tests/": "tests/" + }, + "gitignore": [ + "/phpunit.xml", + "/.phpunit.cache/" + ] +} diff --git a/phpunit/phpunit/10.0/phpunit.dist.xml b/phpunit/phpunit/10.0/phpunit.dist.xml new file mode 100644 index 00000000..580108c2 --- /dev/null +++ b/phpunit/phpunit/10.0/phpunit.dist.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + tests + + + + + + src + + + + + + diff --git a/phpunit/phpunit/10.0/tests/bootstrap.php b/phpunit/phpunit/10.0/tests/bootstrap.php new file mode 100644 index 00000000..8276338c --- /dev/null +++ b/phpunit/phpunit/10.0/tests/bootstrap.php @@ -0,0 +1,9 @@ +bootEnv(dirname(__DIR__).'/.env'); +} diff --git a/phpunit/phpunit/4.7/tests/bootstrap.php b/phpunit/phpunit/4.7/tests/bootstrap.php index 469dccee..8276338c 100644 --- a/phpunit/phpunit/4.7/tests/bootstrap.php +++ b/phpunit/phpunit/4.7/tests/bootstrap.php @@ -4,8 +4,6 @@ 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')) { +if (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } diff --git a/phpunit/phpunit/9.3/tests/bootstrap.php b/phpunit/phpunit/9.3/tests/bootstrap.php index 469dccee..8276338c 100644 --- a/phpunit/phpunit/9.3/tests/bootstrap.php +++ b/phpunit/phpunit/9.3/tests/bootstrap.php @@ -4,8 +4,6 @@ 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')) { +if (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } diff --git a/phpunit/phpunit/9.6/tests/bootstrap.php b/phpunit/phpunit/9.6/tests/bootstrap.php index 469dccee..8276338c 100644 --- a/phpunit/phpunit/9.6/tests/bootstrap.php +++ b/phpunit/phpunit/9.6/tests/bootstrap.php @@ -4,8 +4,6 @@ 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')) { +if (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index 2fbd2eaf..784a5332 100644 --- a/symfony/panther/1.0/manifest.json +++ b/symfony/panther/1.0/manifest.json @@ -19,6 +19,20 @@ "content": " ", "position": "after_target", "target": "", + "warn_if_missing": false + }, + { + "file": "phpunit.dist.xml", + "content": " ", + "position": "after_target", + "target": "", + "warn_if_missing": false + }, + { + "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 } ]