pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.07k stars 315 forks source link

[Bug] provided explaination for static closures #1117

Open peterfox opened 3 months ago

peterfox commented 3 months ago

Currently, if you try to set up a test with a static closure the test fails but the description is somewhat vague and points to a Laravel class for some reason.

CleanShot 2024-03-17 at 16 52 29@2x

What:

Description:

This PR aims to give a dedicated exception for when a closure is provided that is static.

Related:

I appreciate this PR adds an extra dependency to be able to perform reflections on the closure itself. I would personally say it's worthwhile as it's a Laravel package and it doesn't carry any additional dependencies itself.

Realised I could use ReflectFunction instead