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

Migrate to phpspec/prophecy-phpunit #178

Closed
wants to merge 3 commits into from

Conversation

athos-ribeiro
Copy link

sebastianbergmann/phpunit#5033 changed phpunit
to no longer depend on phpspec/prophecy. This results in the need to add
a development dependency for phpspec/prophecy. Doing so results in a
warning, since PHPUnit\Framework\TestCase::prophesize() is deprecated
and will be removed in PHPUnit 10. Let's use the trait provided by
phpspec/prophecy-phpunit instead.

sebastianbergmann/phpunit#5033 changed phpunit
to no longer depend on phpspec/prophecy. This results in the need to add
a development dependency for phpspec/prophecy. Doing so results in a
warning, since PHPUnit\Framework\TestCase::prophesize() is deprecated
and will be removed in PHPUnit 10. Let's use the trait provided by
phpspec/prophecy-phpunit instead.

* Fixes myclabs#177
@athos-ribeiro
Copy link
Author

Note that phpspec/prophecy-phpunit v2.0.0 requires php ^7.3. One alternative here would be to just require phpspec/prophecy instead. But then, such support will be dropped for phpunit 10.

Thoughts?

@mnapoli
Copy link
Member

mnapoli commented Sep 6, 2022

Thanks for the PR!

I would be fine dropping support for older PHP versions and require PHP 7.4+, would that work?

@athos-ribeiro
Copy link
Author

It works for me, but then, would it cause any trouble for other users? If in doubt we can always just require phpspec/prophecy and delay the decision!

@mnapoli
Copy link
Member

mnapoli commented Sep 8, 2022

If in doubt we can always just require phpspec/prophecy and delay the decision!

Ah sorry I missed that, yeah that sounds great!

This reverts commit e03ad06.
Supporting phpspec/prophecy-phpunit at this point, would require
dropping php <= 7.2 support. We can re-visit this matter once we start
supporting phpunit 10.
While e03ad06 (reverted) is not applied, we require phpspec/prophecy as
a development dependency. This is needed because phpunit dropped
ptophecy as a dependency in recent releases. See e03ad06 for further
reference.
@athos-ribeiro
Copy link
Author

I lowered the dependency version to one that should accept php 7.1 now :)

@szepeviktor
Copy link
Contributor

Done in #183

@mnapoli
Copy link
Member

mnapoli commented Mar 8, 2023

🚀

@mnapoli mnapoli closed this Mar 8, 2023
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.

phpspec/prophecy is now explicitely needed for tests
3 participants