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

Mysterious error #548

Closed
fedeisas opened this Issue Feb 10, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@fedeisas
Copy link

fedeisas commented Feb 10, 2016

Hi there! I'm having this error when running my full suite with paratest on Jenkins.

PHP Fatal error:  Call to a member function __call() on null in Mockery/Loader/EvalLoader.php(16) : eval()'d code on line 370

I can't even begin to track where this is happening (large codebase, 1000+ tests).

Is there anyway to have a backtrace of this?

I'm thinking that this is a problem when replacing instances on our DI container with mocked ones, and they get reused on the next test.

@davedevelopment

This comment has been minimized.

Copy link
Collaborator

davedevelopment commented Feb 10, 2016

Put this line in your test bootstrap code, it should help you debug a little:

Mockery::setLoader(new Mockery\Loader\RequireLoader(sys_get_temp_dir()));
@fedeisas

This comment has been minimized.

Copy link
Author

fedeisas commented Feb 11, 2016

Thanks @davedevelopment! I found some broken tests, although still fails.

I found most errors are shouldReceve(...)->with(...) calls.
When the with() part is different, it kinda goes crazy.

I'm wondering what the best practice is for doing argument validation and avoiding this obscures failures.

Maybe starting the mock with a shouldReceive() without with().

@robertbasic

This comment has been minimized.

Copy link
Collaborator

robertbasic commented May 5, 2017

@fedeisas is this still an issue for you?

@fedeisas

This comment has been minimized.

Copy link
Author

fedeisas commented May 18, 2017

@robertbasic yeah, I don't remember much, but I think I was doing something wrong with arguments validation. Thanks!

@fedeisas fedeisas closed this May 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.