8000 [PhpUnitBridge] Deprecate @expectedDeprecation annotation by hkdobrev · Pull Request #36034 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PhpUnitBridge] Deprecate @expectedDeprecation annotation #36034

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

Merged
merged 1 commit into from
Mar 16, 2020
Merged

[PhpUnitBridge] Deprecate @expectedDeprecation annotation #36034

merged 1 commit into from
Mar 16, 2020

Conversation

hkdobrev
Copy link
Contributor
Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? yes
Tickets N/A
License MIT
Doc PR N/A

Addresses https://github.com/orgs/symfony/projects/1#card-32934769 as a follow-up to #35192.

Deprecating @expectedDeprecation annotation on tests in favour of the expectDeprecation() method similar to other PHPUnit deprecations of annotations in favour of methods.

@hkdobrev
Copy link
Contributor Author

I couldn't easily add new tests (it would have been quite ironic to test the deprecation annotation is deprecated using the deprecation method) as Symfo 8000 nyListenerTestsTrait has very little tests itself. Should I just an additional test just for this deprecation which may not cover all of its pre-existing logic?

@hkdobrev hkdobrev changed the title Deprecate @expectedDeprecation annotation [PhpUnitBridge] Deprecate @expectedDeprecation annotation Mar 11, 2020
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

The Symfony test suite will fail (already fails?) as soon as the annotation is used? If yes, this should be updated and maybe this would be enough to consider this tested?

@hkdobrev
Copy link
Contributor Author

@nicolas-grekas

The Symfony test suite will fail (already fails?) as soon as the annotation is used?

I don't think this is the reason it fails.

Initially, I was thinking I should replace all @expectedDeprecation annotations with the new method in the Symfony tests themselves.
But then I realised when used as separate components, the other ones do not require the PHPUnit Bridge where the trait lives.

However, I now realise the tests are being run only on the whole Symfony repo. And since this annotation is only for the tests, I guess we could replace all such annotations with the method in the Symfony tests code. Could you confirm this is the case?

@hkdobrev
Copy link
Contributor Author

Any pointers on why this job failed? I see one error before the tests: https://travis-ci.org/github/symfony/symfony/jobs/661314551#L9698-L9700

But it seems it has not failed the job. I couldn't find a failing test.

Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

We should also update the codebase to the new way.

@nicolas-grekas nicolas-grekas added this to the next milestone Mar 12, 2020
@hkdobrev hkdobrev requested a review from sroze as a code owner March 12, 2020 21:40
@hkdobrev hkdobrev requested a review from nicolas-grekas March 12, 2020 22:12
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(with a minor comment)

@hkdobrev
Copy link
Contributor Author

@nicolas-grekas Thank you for patiently walking me through the deprecation process! I looked at some previous deprecations to try to grasp it, but I guess I was looking at a slightly different case in a x.4.0 release. I hope to be able to help with future deprecations.

@fabpot
Copy link
Member
fabpot commented Mar 16, 2020

Thank you @hkdobrev.

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

Successfully merging this pull request may close these issues.

4 participants
0