pest icon indicating copy to clipboard operation
pest copied to clipboard

[Bug]: Could not bind closure

Open idistack opened this issue 1 year ago • 1 comments

What Happened

Accidently i received this error: image

How to Reproduce

i tried to access $this in beforeAll(), not object context, in Pest.php image

Sample Repository

No response

Pest Version

2.35.0

PHP Version

8.3.8

Operation System

Linux

Notes

No response

idistack avatar Aug 13 '24 12:08 idistack

In Pest, beforeAll() is called before the test class is instantiated. Usage of $this can't be used there. This error may also happen if the test function is defined as static, which also isn't supported.

owenvoke avatar Aug 13 '24 13:08 owenvoke