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

Maximum nesting level reached #98

Open
ghost opened this issue Jun 13, 2015 · 6 comments
Open

Maximum nesting level reached #98

ghost opened this issue Jun 13, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2015

Hey I'm running a very simple test:

`/** @test */
public function it_reserves_an_event()
{
    $this->post('api/v1/reservations', [
        'first_name' => 'rodrigo',
        'last_name' => 'lessa',
        'phone_number' => '9543030759',
        'date' => '2015-06-18',
        'guests' => '5'
    ])
        ->seeJson()
        ->seeStatusCode(200)
        ->seeInDatabase('reservations', [
            'first_name' => 'rodrigo',
            'last_name' => 'lessa',
            'phone_number' => '9543030759',
            'date' => '2015-06-18',
            'guests' => '5'
        ]);
}`

and I get this error:

EPHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/rodrigo/WebApps/ThreeAccents/enjoy_louville/api/enjoy_louville/vendor/laravel/framework/src/Illuminate/Contracts/Cache/Factory.php on line 3

But i know its working because when I use postman that error is not thrown.

@bobbybouwmann
Copy link

Sounds like you're using Xdebug. You need to increase the max nesting level.

http://stackoverflow.com/questions/4293775/increasing-nesting-functions-calls-limit

@ghost
Copy link
Author

ghost commented Jun 14, 2015

@bobbybouwmann It seems like that is just covering up the problem and not getting to the route of the problem

@huglester
Copy link

No. It's just that default nesting is deep threw function calls and class calls.
If there is a loop, rising it to 500 won't help you.

@bmadigan
Copy link

I have put the limit to 200 in my php.ini and even added ini_set('xdebug.max_nesting_level', 200);
I have received this same error for the past 8months using old and new versions of Test Dummy. Never been fixed for me. I cannot run a simple test using them.
OH Well. Sorry I am no help. But this has been the most frustrating issue I've ever come across.

@huglester
Copy link

And if you set it to 500? Or disable xdebug?

@bmadigan
Copy link

I tried 500 and I got a different error. I can't remember exactly but it was something to do with hitting a STDError limit for the stack trace I believe.
Anyways, I figure it was the way the ModelFactory itself was developed (on my end).
If I had a USER and an TENANT models and TENANT had an owner_id which was trying to create a New USER. So I made the owner_id set to 1 and will change it on fly if needed. Seems to work.

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

No branches or pull requests

3 participants