From 9f2382e378cc32078cb8abe832b82044b1dda634 Mon Sep 17 00:00:00 2001 From: Philipp Scheit Date: Wed, 1 Jun 2022 07:06:57 +0200 Subject: [PATCH 1/2] Solution for speedtrap with symfony phpunit bridge --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 89349c0..5ccb7b8 100644 --- a/README.md +++ b/README.md @@ -182,15 +182,20 @@ $ PHPUNIT_SPEEDTRAP=enabled ./vendor/bin/phpunit ## Using with Symfony Framework -**Executing `vendor/bin/simple-phpunit` will not work while PHPUnit SpeedTrap is installed.** +[Symfony Framework](https://symfony.com/) comes with package [symfony/phpunit-bridge](https://packagist.org/packages/symfony/phpunit-bridge) that installs its own version of PHPUnit and **ignores** what is defined in your project's composer.json or composer.lock file. See the PHPUnit versions it installs with command `ls vendor/bin/.phpunit/` -**Use the PHPUnit binary `vendor/bin/phpunit` while PHPUnit SpeedTrap is installed.** +symfony/phpunit-bridge allows environment variable `SYMFONY_PHPUNIT_REQUIRE` to define additional dependencies while installing phpunit. -[Symfony Framework](https://symfony.com/) comes with package [symfony/phpunit-bridge](https://packagist.org/packages/symfony/phpunit-bridge) that installs its own version of PHPUnit and **ignores** what is defined in your project's composer.json or composer.lock file. See the PHPUnit versions it installs with command `ls vendor/bin/.phpunit/` +easiest way to set environment variables for the script simple-phpunit is via phpunit.xml.dist: -symfony/phpunit-bridge allows environment variable `SYMFONY_PHPUNIT_VERSION` to define the PHPUnit version it uses. However, this appears incompatible with PHPUnit SpeedTrap. +phpunit.xml.dist +```xml + + +``` +(add the listener as described above) -Please submit a PR if you have a solution! +if you run `vendor/bin/simple-phpunit` symfony will install phpunit (8) and require phpunit speedtrap (latest version) ## Development From 68828a9db2b2d64c0c2c09370dd9fc66953869bd Mon Sep 17 00:00:00 2001 From: Philipp Scheit Date: Wed, 1 Jun 2022 07:11:59 +0200 Subject: [PATCH 2/2] add version constraint --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ccb7b8..9aad3d1 100644 --- a/README.md +++ b/README.md @@ -190,12 +190,12 @@ easiest way to set environment variables for the script simple-phpunit is via ph phpunit.xml.dist ```xml - + ``` (add the listener as described above) -if you run `vendor/bin/simple-phpunit` symfony will install phpunit (8) and require phpunit speedtrap (latest version) +if you run `vendor/bin/simple-phpunit` symfony will install phpunit (8) and require phpunit speedtrap (4.x.x) ## Development