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

[Bug]: Could not bind closure. #1159

Open
Hackbard opened this issue May 22, 2024 · 1 comment
Open

[Bug]: Could not bind closure. #1159

Hackbard opened this issue May 22, 2024 · 1 comment
Labels

Comments

@Hackbard
Copy link

What Happened

FAILED Tests\Unit\Factories\MenuFactoryTest > it creates a MenuData object from array ShouldNotHappen
This should not happen - please create an new issue here: https://github.com/pestphp/pest.

Issue: Could not bind closure.
PHP version: 8.2.16
Operating system: Darwin
str_replace(): Argument #3 ($subject) must be of type array|string, null given

at vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php:43
39▕ * @return FrameCollection
40▕ /
41▕ public function filter($callable)
42▕ {
➜ 43▕ $this->frames = array_values(array_filter($this->frames, $callable));
44▕ return $this;
45▕ }
46▕
47▕ /
*

How to Reproduce

Write a static test:

it('creates a MenuData object from array', static function () : void {

Sample Repository

No response

Pest Version

2.34.7.

PHP Version

8.2.16

Operation System

macOS

Notes

No response

@Hackbard Hackbard added the bug label May 22, 2024
@owenvoke
Copy link
Member

As far as I know, Pest doesn't support static closures for tests. Should be able to just remove the static keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants