Comments (17)
It doesn't seem to work when I try to use it on a docker image. I'm getting the following error:
Fatal error: Declaration of Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void must be compatible with PHPUnit\Framework\TestListener::addError(PHPUnit\Framework\Test $test, Exception $e, $time) in /tools/.composer/vendor-bin/symfony/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerForV7.php on line 27
Tried it on PHP 7.3.
from toolbox.
@jakzal It's related to phpunit also being a dependency in the current project. I think we're hitting symfony/symfony#27289 (comment) actually
so the conflict seems expected, and in such case the real phpunit should be used (ref). I can confirm it works "as expected" then...
(given the current working directory is at your repo, which requires phpunit directly)
$ SYMFONY_PHPUNIT_VERSION=6.5 simple-phpunit
PHP Fatal error: Declaration of Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7::addError...
$ cd build/
$ SYMFONY_PHPUNIT_VERSION=6.5 simple-phpunit
PHPUnit 6.5.13 by Sebastian Bergmann and contributors.
Usage: ...
to really confirm:
$ vendor/bin/phpunit --version
PHPUnit 7.5.1 by Sebastian Bergmann and contributors
$ composer remove --dev phpunit/phpunit zalas/phpunit-globals
# disable Zalas\PHPUnit\Globals\AnnotationListener in phpunit.xml.dist
$ SYMFONY_PHPUNIT_VERSION=6.5 simple-phpunit
PHPUnit 6.5.13 by Sebastian Bergmann and contributors.
...
So there's no conflict with phpunit from the toolbox, only when available as a project dependency.
This is a feature from simple-phpunit 😅 i dont think we need to wait and/or revert it from the toolbox. IMHO.
from toolbox.
Not sure how this could work. The bridge is meant to be included in project's dependencies. It takes care of preventing depdendency clashes etc. I'm not even sure if it was meant to be used standalone.
from toolbox.
I think that's a feature, not a requirement.
I just tried it as follow;
The current workding dir is /app/src/Domain
which is a public composer package, without a dependency on symfony/phpunit-bridge
I've installed symfony/phpunit-bridge standalone in /app/var/tmp/composer.json
{
"require-dev": {
"symfony/phpunit-bridge": "*"
}
}
Running it
www-data@3e85f8b4414d:/app/src/Domain$ SYMFONY_PHPUNIT_VERSION=7.5 ../../var/tmp/vendor/bin/simple-phpunit
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
Testing msgphp/domain
..............
All good :)
from toolbox.
Sounds good then :) There's few features, like deprecation reports, that are worth having. 👍
from toolbox.
looks related to phpunit6 vs. php7, maybe we need to wait for a release symfony/symfony#29439.
Then again i didnt expect the current stable to be broken.. (https://github.com/symfony/symfony/blob/v4.2.2/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php#L16)
ill try to build locally ASAP, to figure out what's going on. Perhaps @greg0ire knows...
from toolbox.
@jakzal for now running e.g. SYMFONY_PHPUNIT_VERSION=7.5 simple-phpunit
does work, right?
from toolbox.
for now running e.g. SYMFONY_PHPUNIT_VERSION=7.5 simple-phpunit does work, right?
Yes, but it triggers installation.
from toolbox.
we install phpunit 6 by default still (https://travis-ci.com/jakzal/toolbox/jobs/170134793#L803). So that's intended, as you didnt have phpunit 7.5 yet.
im guessing there's some sort of autoloading conflict with the native phpunit binary, which is v7 already.
from toolbox.
im guessing there's some sort of autoloading conflict with the native phpunit binary, which is v7 already.
shouldn't be the case as we use the composer-bin-plugin, which intends to isolate dependencies :)
from toolbox.
from toolbox.
I think it makes sense to wait for symfony/symfony#29439
from toolbox.
im guessing there's some sort of autoloading conflict with the native phpunit binary, which is v7 already.
shouldn't be the case as we use the composer-bin-plugin, which intends to isolate dependencies :)
was my guess also :) but im curious what happens at this point.. so 'll build the toolbox locally ASAP and follow the path.
I think it makes sense to wait for symfony/symfony#29439
think so :) yet it's only about new defaults for SYMFONY_PHPUNIT_VERSION, which you can provide manually today already. But the experience is not OK at the moment for sure :)
from toolbox.
reproduced locally also (php7.1), we definitely go from /var/www/.composer/vendor-bin/symfony/vendor/bin/.phpunit/phpunit-6.5/src
to /app/vendor/phpunit/phpunit/src
somehow..
0.0627 5085408 5. Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV7->doRun() /var/www/.composer/vendor-bin/symfony/vendor/bin/.phpunit/phpunit-6.5/src/TextUI/Command.php:195
0.0627 5085432 6. Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV7->handleConfiguration() /app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:160
still on it :)
from toolbox.
Thanks for getting into the bottom of this. I'm not exactly sure how phpunit bridge can be useful while it's installed this way, but let's give it a try 👍
from toolbox.
I'm not exactly sure how phpunit bridge can be useful while it's installed this way
the incompatibility with project dependencies definitely can hurt, but in this case you should either require phpunit/phpunit OR sf/phpunit-bridge. Having both in your project is pointless.
same for global vs. local phpunit, your project should rely on only 1 approach.
For example i have a monolith repo which holds N composer packages. I removed the simple-phpunit dependency from all of its packages, in favor of a global install in the monolith root. Now i can drop the global install too, in favor of the PHPQA toolbox.
from toolbox.
The latest tag of phpqa now also offers simple-phpunit: https://hub.docker.com/r/jakzal/phpqa/builds
Thanks @ro0NL!
from toolbox.
Related Issues (20)
- Please update PHP-CS-Fixer to version 3 HOT 1
- Cannot run with composer docker image HOT 1
- Install composer-require-checker from phar when it's released again
- Drop dunglas/phpdoc-to-typehint
- New twig (3.x) linter HOT 3
- Declare allow-plugins for each composer plugin installed with toolbox HOT 1
- Unlock larastan version as soon as stable lar***l release is made (revert #418)
- phpstan/extension-installer missing ? HOT 3
- Updates to Phive-managed tools HOT 4
- impossible to install the phpstan/extension-installer and other plugins HOT 5
- Generate $PATH HOT 1
- Support phive auth file
- Add gherkin-lint-php HOT 2
- Unlock psalm v5 as soon as plugins have caught up
- Update infection tool HOT 3
- PHPUnit 9 support HOT 1
- Add PHPArkitect tool HOT 2
- Add pest Tool HOT 1
- Add lines in replacement of phploc
- Support for twig-cs-fixer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toolbox.