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

phpspec/prophecy is now explicitely needed for tests #50

Closed
DavidPrevot opened this issue Aug 28, 2022 · 1 comment · Fixed by #51
Closed

phpspec/prophecy is now explicitely needed for tests #50

DavidPrevot opened this issue Aug 28, 2022 · 1 comment · Fixed by #51
Milestone

Comments

@DavidPrevot
Copy link

Hi,

Since PHPUnit dropped phpspec/prophecy from its dependencies (sebastianbergmann/phpunit#5033), the following errors are triggered when running the testsuite with latest PHPUnit.

There were 5 errors:

1) phpmock\phpunit\MockObjectProxyTest::testExpects
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc.hxywsvl5/downtmp/build.90r/src/tests/MockObjectProxyTest.php:40

2) phpmock\phpunit\MockObjectProxyTest::testHasMatcher
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc.hxywsvl5/downtmp/build.90r/src/tests/MockObjectProxyTest.php:99

3) phpmock\phpunit\MockObjectProxyTest::testProxiedMethods with data set #0 ('__phpunit_getInvocationHandler', array(), PHPUnit\Framework\MockObject\InvocationHandler Object (...))
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc.hxywsvl5/downtmp/build.90r/src/tests/MockObjectProxyTest.php:120

4) phpmock\phpunit\MockObjectProxyTest::testProxiedMethods with data set #1 ('__phpunit_setOriginalObject', array('bar'))
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc.hxywsvl5/downtmp/build.90r/src/tests/MockObjectProxyTest.php:120

5) phpmock\phpunit\MockObjectProxyTest::testProxiedMethods with data set #2 ('__phpunit_verify', array(true))
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc.hxywsvl5/downtmp/build.90r/src/tests/MockObjectProxyTest.php:120

Regards

David

athos-ribeiro added a commit to athos-ribeiro/php-mock-phpunit that referenced this issue Sep 6, 2022
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. While we could use the trait provided
by phpspec/prophecy-phpunit instead, it would break PHP < 7.3 support.

* Closes php-mock#50
@michalbundyra michalbundyra added this to the 2.6.1 milestone Sep 7, 2022
michalbundyra pushed a commit that referenced this issue Sep 7, 2022
* Require phpspec/prophecy as dev dependency

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. While we could use the trait provided
by phpspec/prophecy-phpunit instead, it would break PHP < 7.3 support.

* Closes #50
@michalbundyra
Copy link
Member

thanks @DavidPrevot , 2.6.1 released

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 a pull request may close this issue.

2 participants