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 #3227

Closed
DavidPrevot opened this issue Aug 28, 2022 · 2 comments
Closed

phpspec/prophecy is now explicitely needed for tests #3227

DavidPrevot opened this issue Aug 28, 2022 · 2 comments

Comments

@DavidPrevot
Copy link

Bug Report

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 2 errors:

1) Slim\Tests\Http\RequestTest::testGetRequestTargetWithSlimPsr7Uri
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc._6y23c80/downtmp/build.jLX/src/tests/Http/RequestTest.php:458
/usr/bin/phpunit:73

2) Slim\Tests\Http\RequestTest::testGetRequestTargetWithNonSlimPsr7Uri
PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".

/tmp/autopkgtest-lxc._6y23c80/downtmp/build.jLX/src/tests/Http/RequestTest.php:477
/usr/bin/phpunit:73

Regards

David

@odan
Copy link

odan commented Aug 28, 2022

Have you tried to install phpspec/prophecy?

composer require phpspec/prophecy --dev

I guess the problem could be solved by adding phpspec/prophecy as a dev dependency to the project.

TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Using the trait provided by phpspec/prophecy-phpunit may help here.

@l0gicgate
Copy link
Member

The dependency is in our require-dev:
https://github.com/slimphp/Slim/blob/4.x/composer.json#L65

The test suite runs fine.

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

No branches or pull requests

3 participants