-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Recommend Prophecy for test doubles creation #198
Recommend Prophecy for test doubles creation #198
Conversation
Since phpunit 4.5, phpunit requires and [integrates](https://phpunit.de/manual/current/en/test-doubles.html#test-doubles.prophecy) | ||
the [phpspec/prophecy](https://github.com/phpspec/prophecy). | ||
Historically, Sonata has been using [the built-in test doubles implementation](https://phpunit.de/manual/current/en/test-doubles.html), | ||
but has deciding to move to Prophecy, which is more concise than its built-in counterpart is most cases. |
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.
maybe link to the discussion, if someone is interested?
LGTM 👍 |
6ea1599
to
e1e9a26
Compare
@OskarStark : I changed some things, please review it again entirely. |
@@ -97,6 +97,24 @@ Some rules have to be respected about the test: | |||
* Most of the time, the test class should have the same name as the targeted class, suffixed by `Test`. | |||
* The `@expectedException*` annotations are prohibited. Use `PHPUnit_Framework_TestCase::setExpectedException()`. | |||
|
|||
##### Using test doubles | |||
|
|||
Since phpunit 4.5, phpunit requires and [integrates](https://phpunit.de/manual/current/en/test-doubles.html#test-doubles.prophecy) |
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 -> PHPUnit
Because, it is it name. 😛
e1e9a26
to
1bc94b9
Compare
Good job @greg0ire, i like it 👍 |
@@ -97,6 +97,24 @@ Some rules have to be respected about the test: | |||
* Most of the time, the test class should have the same name as the targeted class, suffixed by `Test`. | |||
* The `@expectedException*` annotations are prohibited. Use `PHPUnit_Framework_TestCase::setExpectedException()`. | |||
|
|||
##### Using test doubles | |||
|
|||
Since version 4.5, PHPUnit requires and [integrates](https://phpunit.de/manual/current/en/test-doubles.html#test-doubles.prophecy) |
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.
should we link to "current" or version 4.5 explicitely?
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.
We should link to current b/c we are using the current version in our software. No need to link to outdated instructions
LGTM, we should start moving to prophecy 👍 |
@soullivaneuh this is 6 months old. What's the deal? |
Fixes #89.