-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[PhpUnitBridge] Doc for @expectedDeprecation & new configuration env vars #7074
Conversation
/** | ||
* @group legacy | ||
* @expectedDeprecation This "%s" method is deprecated. | ||
* @expectedDeprecation The second argument of the "%s" method is deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the order of annotations important ? If they must be in the same order than the triggered deprecation, this should be documented (or changed in the code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is, open for discussion for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note added above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -18,9 +18,9 @@ It comes with the following features: | |||
|
|||
* Displays the stack trace of a deprecation on-demand; | |||
|
|||
* Provides a ``ClockMock`` helper class for time-sensitive tests. | |||
* Provides a ``ClockMock`` and ``DnsMock`` helpers class for time or network-sensitive tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpers class
-> helper classes
db04ea6
to
845d094
Compare
…cation` (nicolas-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [PhpUnitBridge] Replace ErrorAssert by `@expectedDeprecation` | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18880 | License | MIT | Doc PR | symfony/symfony-docs#7074 For 3.2, that's what the feat. freeze is for in this case. ping @xabbuh See https://github.com/symfony/symfony/pull/20255/files?w=1 Commits ------- c344203 [PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation
…unit versions (nicolas-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [PhpUnitBridge] Allow configuring removed deps and phpunit versions | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#7074 Allowing greater reuse of the wrapper. Commits ------- fb1c5b8 [PhpUnitBridge] Allow configuring removed deps and phpunit versions
…unit versions (nicolas-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [PhpUnitBridge] Allow configuring removed deps and phpunit versions | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#7074 Allowing greater reuse of the wrapper. Commits ------- fb1c5b8 [PhpUnitBridge] Allow configuring removed deps and phpunit versions
Write Assertions about Deprecations | ||
----------------------------------- | ||
|
||
When adding deprecations to your code, you might like writting tests that verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: writting -> writing
When adding deprecations to your code, you might like writting tests that verify | ||
that they are triggered as required. To do so, the bridge provides the | ||
``@expectedDeprecation`` annotation that you can use on your test methods, | ||
alongside with the expected message, given in the same format than for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"[...] that you can use on your test methods. It requires you to pass the expected message, [...]"
``@expectedDeprecation`` annotation that you can use on your test methods, | ||
alongside with the expected message, given in the same format than for the | ||
`PHPUnit assertStringMatchesFormat()`_ method. If you expect more than one | ||
deprecation messages for a given test method, you can use the annotation several |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"messages" -> "message"
.. tip:: | ||
|
||
Set the ``SYMFONY_PHPUNIT_REMOVE`` env var to ``symfony/yaml`` if you need | ||
``prophecy`` but not ``symfony/yaml``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "if you need" mean? Am I not able to use Prophecy if I don't set this env var to symfony/yaml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: as stated before, the default is to have prophecy and symfony/yaml removed
that they are triggered as required. To do so, the bridge provides the | ||
``@expectedDeprecation`` annotation that you can use on your test methods, | ||
alongside with the expected message, given in the same format than for the | ||
`PHPUnit assertStringMatchesFormat()`_ method. If you expect more than one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"PHPUnit's assertStringMatchesFormat() method"
845d094
to
a1682de
Compare
Comments addressed |
👍 |
Thank you @nicolas-grekas. |
…iguration env vars (nicolas-grekas) This PR was merged into the master branch. Discussion ---------- [PhpUnitBridge] Doc for @expectedDeprecation & new configuration env vars Related to symfony/symfony#20255 & symfony/symfony#20256 Commits ------- a1682de [PhpUnitBridge] Doc for @expectedDeprecation & new configuration env vars
Related to symfony/symfony#20255 & symfony/symfony#20256