Skip to content

Commit a88b3d4

Browse files
authored
Merge pull request #92 from pscheit/patch-1
Solution for speedtrap with symfony phpunit bridge
2 parents 5f9b160 + 68828a9 commit a88b3d4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,20 @@ $ PHPUNIT_SPEEDTRAP=enabled ./vendor/bin/phpunit
182182

183183
## Using with Symfony Framework
184184

185-
**Executing `vendor/bin/simple-phpunit` will not work while PHPUnit SpeedTrap is installed.**
185+
[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/`
186186

187-
**Use the PHPUnit binary `vendor/bin/phpunit` while PHPUnit SpeedTrap is installed.**
187+
symfony/phpunit-bridge allows environment variable `SYMFONY_PHPUNIT_REQUIRE` to define additional dependencies while installing phpunit.
188188

189-
[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/`
189+
easiest way to set environment variables for the script simple-phpunit is via phpunit.xml.dist:
190190

191-
symfony/phpunit-bridge allows environment variable `SYMFONY_PHPUNIT_VERSION` to define the PHPUnit version it uses. However, this appears incompatible with PHPUnit SpeedTrap.
191+
phpunit.xml.dist
192+
```xml
193+
<env name="SYMFONY_PHPUNIT_REQUIRE" value="johnkary/phpunit-speedtrap:4"/>
194+
<env name="SYMFONY_PHPUNIT_VERSION" value="8"/>
195+
```
196+
(add the listener as described above)
192197

193-
Please submit a PR if you have a solution!
198+
if you run `vendor/bin/simple-phpunit` symfony will install phpunit (8) and require phpunit speedtrap (4.x.x)
194199

195200
## Development
196201

0 commit comments

Comments
 (0)