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

Add a trait with most of the implementation #19

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Conversation

stof
Copy link
Member

@stof stof commented Mar 24, 2020

This makes it easier to add Prophecy support when needing to extend a testcase providing other features (many frameworks are shipping their own base test cases).

README.md Outdated
@@ -49,3 +49,29 @@ The special ``ProphecyTestCase`` exposes a method ``prophesize($classOrInterface
to use Prophecy.
For the usage of the Prophecy doubles, please refer to the [Prophecy documentation](https://github.com/phpspec/prophecy).

If you need to the Prophecy integration alongside a custom base TestCase rather than the PHPUnit one, a trait is available with all the necessary logic, except the override of the PHPUnit `verifyMockObjects` method (which cannot be provided by a trait). Use it like that:

Choose a reason for hiding this comment

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

Suggested change
If you need to the Prophecy integration alongside a custom base TestCase rather than the PHPUnit one, a trait is available with all the necessary logic, except the override of the PHPUnit `verifyMockObjects` method (which cannot be provided by a trait). Use it like that:
If you need the Prophecy integration alongside a custom base TestCase rather than the PHPUnit one, a trait is available with all the necessary logic, except the override of the PHPUnit `verifyMockObjects` method (which cannot be provided by a trait). Use it like that:

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I meant If you need to use the Prophecy integration

This makes it easier to add Prophecy support when needing to extend a
testcase providing other features (many frameworks are shipping their
own base test cases).
@stof stof merged commit ad48e88 into phpspec:master Mar 24, 2020
@stof stof deleted the trait branch March 24, 2020 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants