Skip to content

Commit

Permalink
Merge pull request #92 from pscheit/patch-1
Browse files Browse the repository at this point in the history
Solution for speedtrap with symfony phpunit bridge
  • Loading branch information
johnkary authored Oct 15, 2022
2 parents 5f9b160 + 68828a9 commit a88b3d4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<env name="SYMFONY_PHPUNIT_REQUIRE" value="johnkary/phpunit-speedtrap:4"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="8"/>
```
(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 (4.x.x)

## Development

Expand Down

0 comments on commit a88b3d4

Please sign in to comment.