-
Notifications
You must be signed in to change notification settings - Fork 129
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
How to return values from mocked method using test::spec #147
Comments
your 'fakeMethod' => function () use ($fakeValue) {
return $fakeValue;
} |
Doh. I'll have to try this then, thanks. |
I'm still having problems with this. Here's my latest example.
This should return a 1 and codecept_debug twice. It only logs once and prints this:
I've also tried putting the array of methods to override inside the construct() call. It does the same thing. |
Here's a test I wrote in my codeception unit test that fails with this:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to return fake values from mocked methods using an object created with
test::spec
? I've tried this and it never seems to call my fake method:Then when I call $mock->fakeMethod() it's not returning my fakeValue;
Is this just supported or am I doing something wrong?
The text was updated successfully, but these errors were encountered: