-
-
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
Remove Prophecy in Sonata project #624
Comments
I think we could use the trait contributed here: phpspec/prophecy-phpunit#20 There will probably be a rector for this soon |
@sonata-project/contributors I feel like this could be reconsidered Here, prophecy was recommended: #89 But if I search for
And I reviewed more PR with Shouldn't we recommend to follow the majority ? |
Another argument in favor of PHPunit is how better it plays with PHPStan and Psalm, in my experience it is easier to work with, but maybe my experience is outdated. |
IMO phpuniy has improved a lot since when we recommended using prophecy. Now they look similar and we could consider stop using it. |
I prefer prophecy, because you can better mock method calls with different arguments. PHPUnit still requires the exact call order. You can also archive the same result with writing less code. (And the API is similar in Java :D) prophecy: $this->request->get('start')->willReturn('2016-03-01');
$this->request->get('end')->willReturn('2016-03-19 15:11:00'); phpunit $this->request->expects(static::exactly(2))
->method('get')
->withConsecutive(
['start'],
['end'],
)
->willReturn(
'2016-03-01',
'2016-03-19 15:11:00'
)
; |
Maybe one day it won't :) I'm sure we will always find people who prefer prophecy and some who prefer phpunit. |
This is almost done, AFAIK it only needs to be removed from docs now |
Could you provide a TODO list @jordisala1991 ? :) |
it's done https://github.com/search?q=org%3Asonata-project+prophesize&type=code I created the PR for the doc #1369 |
Cf: sebastianbergmann/phpunit#4141
Should we try to remove the dependency and re-write the tests with prophecy ?
The text was updated successfully, but these errors were encountered: