From b24a3c932304e6e9358507af9c12ad9a29ee5773 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 12 Sep 2023 01:12:53 +0200 Subject: [PATCH 1/3] Add Recipe for PHPUnit 10 --- 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 | 11 ++++++++ symfony/panther/1.0/manifest.json | 14 ++++++++++ 5 files changed, 74 insertions(+) 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 000000000..24a43c03b --- /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 000000000..a35670abb --- /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 000000000..45aa89cf9 --- /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 000000000..469dccee4 --- /dev/null +++ b/phpunit/phpunit/10.0/tests/bootstrap.php @@ -0,0 +1,11 @@ +bootEnv(dirname(__DIR__).'/.env'); +} diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index 2fbd2eafd..bdc3ac723 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 } ] From d32976833f89c0ad06e633243d3097e4ae611514 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 5 Mar 2025 19:10:17 +0100 Subject: [PATCH 2/3] Reapply suggestions --- phpunit/phpunit/10.0/phpunit.dist.xml | 2 +- symfony/panther/1.0/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit/phpunit/10.0/phpunit.dist.xml b/phpunit/phpunit/10.0/phpunit.dist.xml index 45aa89cf9..580108c23 100644 --- a/phpunit/phpunit/10.0/phpunit.dist.xml +++ b/phpunit/phpunit/10.0/phpunit.dist.xml @@ -14,7 +14,7 @@ - + diff --git a/symfony/panther/1.0/manifest.json b/symfony/panther/1.0/manifest.json index bdc3ac723..784a53322 100644 --- a/symfony/panther/1.0/manifest.json +++ b/symfony/panther/1.0/manifest.json @@ -29,7 +29,7 @@ "warn_if_missing": false }, { - "file": "env.test", + "file": ".env.test", "content": "PANTHER_APP_ENV=panther\nPANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots", "position": "after_target", "target": "SYMFONY_DEPRECATIONS_HELPER=999999", From 80db62ced1a88643b46353cb06cfb4008221e51a Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 6 Mar 2025 17:55:32 +0100 Subject: [PATCH 3/3] Remove bridge to Symfony 4.4 bootstrap file --- phpunit/phpunit/10.0/tests/bootstrap.php | 4 +--- phpunit/phpunit/4.7/tests/bootstrap.php | 4 +--- phpunit/phpunit/9.3/tests/bootstrap.php | 4 +--- phpunit/phpunit/9.6/tests/bootstrap.php | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/phpunit/phpunit/10.0/tests/bootstrap.php b/phpunit/phpunit/10.0/tests/bootstrap.php index 469dccee4..8276338c7 100644 --- a/phpunit/phpunit/10.0/tests/bootstrap.php +++ b/phpunit/phpunit/10.0/tests/bootstrap.php @@ -4,8 +4,6 @@ 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/4.7/tests/bootstrap.php b/phpunit/phpunit/4.7/tests/bootstrap.php index 469dccee4..8276338c7 100644 --- a/phpunit/phpunit/4.7/tests/bootstrap.php +++ b/phpunit/phpunit/4.7/tests/bootstrap.php @@ -4,8 +4,6 @@ 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 469dccee4..8276338c7 100644 --- a/phpunit/phpunit/9.3/tests/bootstrap.php +++ b/phpunit/phpunit/9.3/tests/bootstrap.php @@ -4,8 +4,6 @@ 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 469dccee4..8276338c7 100644 --- a/phpunit/phpunit/9.6/tests/bootstrap.php +++ b/phpunit/phpunit/9.6/tests/bootstrap.php @@ -4,8 +4,6 @@ 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'); }