Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bridge/PhpUnit] Add PHPUnit 6 support#21694

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedFeb 20, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21125
LicenseMIT
Doc PR-

This PR makes our phpunit bridge compatible with all namespaced versions of phpunit, from 4.8.35 to 6.
It takes another approach than#21668 and#21221, thus replaces them.
Tested locally : tests pass when using phpunit 5.7, and fails with v6.0 because our own test suite is not yet compatible with it - but at least it runs nice.
If this were handled as usual Symfony component, we would consider some changes to be BC breaks. But in this specific case - a phpunit bridge - it makes no sense to me to apply the bc policy here. I added@final and@internal annotations to make this clearer.

\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] =1;
}else {
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\DeprecationErrorHandler'] =1;
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] =1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why not using::class here ?

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasFeb 21, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In fact I fogot that the bridge needs to be PHP 5.3 compatible, so I removed all the::class

@peterrehm
Copy link
Contributor

peterrehm commentedFeb 21, 2017
edited
Loading

Awesome 👍

return;
}

$UtilPrefix =class_exists('PHPUnit_Util_ErrorHandler') ?'PHPUnit_Util_' :'PHPUnit\Util\\';
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasFeb 21, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note that I used this upper-first convention in this PR for the compatibility variables that hold the class names to use

@garak
Copy link
Contributor

+1 for not applying BC policy

@stof
Copy link
Member

What are the BC breaks here ?

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedFeb 21, 2017
edited
Loading

@stof the type hints on the listener methods and the parent class of the TextUI classes - which all switch to namespaces when phpunit 6 is used

@stof
Copy link
Member

Well, the typehints are OK IMO. People are not expected to extend these classes, and the calling code is PHPUnit itself. And the signature comes from PHPUnit anyway.
As long as there is no BC break for people registering the listener in their phpunit.xml config, this is fine with me.

@nicolas-grekas
Copy link
MemberAuthor

Same to me, that's what is done here :)

@nicolas-grekasnicolas-grekas merged commit9e0745c intosymfony:masterFeb 21, 2017
nicolas-grekas added a commit that referenced this pull requestFeb 21, 2017
This PR was merged into the 3.3-dev branch.Discussion----------[Bridge/PhpUnit] Add PHPUnit 6 support| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21125| License       | MIT| Doc PR        | -This PR makes our phpunit bridge compatible with all namespaced versions of phpunit, from 4.8.35 to 6.It takes another approach than#21668 and#21221, thus replaces them.Tested locally : tests pass when using phpunit 5.7, and fails with v6.0 because our own test suite is not yet compatible with it - but at least it runs nice.If this were handled as usual Symfony component, we would consider some changes to be BC breaks. But in this specific case - a phpunit bridge - it makes no sense to me to apply the bc policy here. I added `@final` and `@internal` annotations to make this clearer.Commits-------9e0745c [Bridge/PhpUnit] Add PHPUnit 6 support
@nicolas-grekasnicolas-grekas deleted the phpunit6-bridge branchFebruary 21, 2017 10:51
nicolas-grekas added a commit that referenced this pull requestFeb 21, 2017
This PR was merged into the 2.7 branch.Discussion----------Use PHPUnit 6.0 on PHP 7.* test lines| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | need#21694 first| Fixed tickets | -| License       | MIT| Doc PR        | -Commits-------96ecd3c Use PHPUnit 6.0 on PHP 7.* test lines
@garak
Copy link
Contributor

Just tried the latest update with phpunit 6, I'm gettingPHP Fatal error: Uncaught Error: Class 'PHPUnit_Util_ErrorHandler' not found in vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:73

@xabbuh
Copy link
Member

Did you update your local installation of the bridge (composer update symfony/phpunit-bridge)?

@garak
Copy link
Contributor

Here are relevant parts from mycomposer show:

phpunit/phpunit 6.0.8
symfony/phpunit-bridge v3.2.4
symfony/symfony v2.8.18

@xabbuh
Copy link
Member

This PR was not merged when 3.2.4 was released. You have to wait for 3.2.5 then.

@nicolas-grekas
Copy link
MemberAuthor

In fact, this PR has been merged in 3.3,
and there is no plan to make any previous versions compatible with phpunit 6.

afoeder and mmoll reacted with confused emoji

@garak
Copy link
Contributor

OK, using"symfony/phpunit-bridge": "3.3.*@dev" is working. Thanks

@garakgarak mentioned this pull requestMar 8, 2017
@fabpotfabpot mentioned this pull requestMay 1, 2017
@aertmann
Copy link

waiting for a stable :D thanks guys

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@TaluuTaluuTaluu left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

8 participants

@nicolas-grekas@peterrehm@garak@stof@xabbuh@aertmann@Taluu@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp