Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
9.49k
stars
343
forks
source link
[Bug]: toHaveMethod expectation does not work correctly #1043
Closed
marepilc closed 9 months ago
What Happened
The test
returns AssertionError:
AssertionError: assert(is_string($expectation->value) || is_array($expectation->value))
When changed to
expect($user)->toHaveMethods(['isAdmin']);
the test passes.How to Reproduce
Add
$table->boolean('is_admin')->default(false);
to the default users table andisAdmin
method to the User modelSample Repository
No response
Pest Version
2.28.1
PHP Version
8.2.7
Operation System
Windows
Notes
No response