Skip to content
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

Merged
merged 1 commit into from
Oct 26, 2016

Conversation

nicolas-grekas
Copy link
Member

/**
* @group legacy
* @expectedDeprecation This "%s" method is deprecated.
* @expectedDeprecation The second argument of the "%s" method is deprecated.
Copy link
Member

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)

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Note added above

Copy link
Member

@javiereguiluz javiereguiluz left a 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.
Copy link
Member

Choose a reason for hiding this comment

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

helpers class -> helper classes

@nicolas-grekas nicolas-grekas force-pushed the phpunit-new branch 2 times, most recently from db04ea6 to 845d094 Compare October 21, 2016 15:43
fabpot added a commit to symfony/symfony that referenced this pull request Oct 21, 2016
…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
fabpot added a commit to symfony/symfony that referenced this pull request Oct 21, 2016
…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
symfony-splitter pushed a commit to symfony/phpunit-bridge that referenced this pull request Oct 21, 2016
…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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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``.
Copy link
Member

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?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Oct 23, 2016

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
Copy link
Member

Choose a reason for hiding this comment

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

"PHPUnit's assertStringMatchesFormat() method"

@nicolas-grekas
Copy link
Member Author

Comments addressed
Status: needs review

@wouterj
Copy link
Member

wouterj commented Oct 23, 2016

👍
status: reviewed

@xabbuh
Copy link
Member

xabbuh commented Oct 26, 2016

Thank you @nicolas-grekas.

@xabbuh xabbuh merged commit a1682de into symfony:master Oct 26, 2016
xabbuh added a commit that referenced this pull request Oct 26, 2016
…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
xabbuh added a commit that referenced this pull request Oct 26, 2016
@nicolas-grekas nicolas-grekas deleted the phpunit-new branch July 1, 2018 20:44
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.

6 participants