Skip to content

phpunit-bridge compatibility with phpunit v7.* #26931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
juliendufresne opened this issue Apr 15, 2018 · 4 comments
Closed

phpunit-bridge compatibility with phpunit v7.* #26931

juliendufresne opened this issue Apr 15, 2018 · 4 comments

Comments

@juliendufresne
Copy link

juliendufresne commented Apr 15, 2018

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.*

Since this commit of PHPUnit, PHPUnit has added return types to some methods.

This causes some compatibility issue when using PHPUnit version 7 or later and symfony/phpunit-bridge.

For example, the method Symfony\Bridge\PhpUnit\TextUI\Command::createRunner() does not specify the return type.

Output of `SYMFONY_PHPUNIT_VERSION=7.0 php vendor/bin/simple-phpunit`

PHP Fatal error: Declaration of Symfony\Bridge\PhpUnit\TextUI\Command::createRunner() must be compatible with PHPUnit\TextUI\Command::createRunner(): PHPUnit\TextUI\TestRunner in <path>/vendor/symfony/phpunit-bridge/TextUI/Command.php on line 24

@nicolas-grekas
Copy link
Member

@greg0ire maybe you'd like to have a look?

@greg0ire
Copy link
Contributor

greg0ire commented Apr 20, 2018

@nicolas-grekas will do :) Fun fact: @juliendufresne is one of my new colleagues

@geoff-maddock
Copy link

Running into this. Any fix pending?

./bin/phpunit -v
#!/usr/bin/env php

Fatal error: Declaration of Symfony\Bridge\PhpUnit\TextUI\TestRunner::handleConfiguration(array &$arguments) must be compatible with PHPUnit\TextUI\TestRunner::handleConfiguration(array &$arguments): void in /srv/myapp/vendor/symfony/phpunit-bridge/TextUI/TestRunner.php on line 25

@greg0ire
Copy link
Contributor

@geoff-maddock currently looking into it.

greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 20, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 21, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 21, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 21, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 22, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
greg0ire added a commit to greg0ire/symfony that referenced this issue Apr 22, 2018
This makes classes inheriting from phpunit classes compatible with phpunit 7.
Fixes symfony#26931
nicolas-grekas added a commit that referenced this issue Apr 22, 2018
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Add type hints

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (only changed classes marked as internal)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26931
| License       | MIT
| Doc PR        | n/a

This makes classes inheriting from phpunit classes compatible with phpunit 7.

Commits
-------

6fbcc51 Add type hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants