I've encountered problem after upgrading my Symfony from 2.1 to 2.2. When runing all functional tests at once (notice this isn't happening when single tests are being run, no matter which) I get an error with infinity loop stucked at
PHP Fatal error: Maximum function nesting level of '150' reached, aborting! in project_path\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\DebugClassLoader.php on line 81
Part of trace:
...
14. Symfony\Component\BrowserKit\Client->submit() project_path\other_path\Tests\Controller\LoginControllerTest.php:53
15. Symfony\Component\BrowserKit\Client->request() project_path\vendor\symfony\symfony\src\Symfony\Component\BrowserKit\Client.php:224
16. Symfony\Bundle\FrameworkBundle\Client->doRequest() project_path\vendor\symfony\symfony\src\Symfony\Component\BrowserKit\Client.php:264
17. Symfony\Component\HttpKernel\Client->doRequest() project_path\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Client.php:111
18. Symfony\Component\HttpKernel\Kernel->handle() project_path\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Client.php:61
19. Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle() project_path\app\bootstrap.php.cache:411
20. Symfony\Component\HttpKernel\HttpKernel->handle() project_path\app\bootstrap.php.cache:1101
21. Symfony\Component\HttpKernel\HttpKernel->handleRaw() project_path\app\bootstrap.php.cache:975
22. Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher->dispatch() project_path\app\bootstrap.php.cache:990
23. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() project_path\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher.php:135
24. Symfony\Component\EventDispatcher\EventDispatcher->dispatch() project_path\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.php:167
25. Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() project_path\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:53
26. call_user_func() project_path\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:164
27. Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}() project_path\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:164
28. call_user_func() project_path\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher.php:447
29. Symfony\Component\Security\Http\Firewall->onKernelRequest() project_path\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher.php:447
30. Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener->handle() project_path\vendor\symfony\symfony\src\Symfony\Component\Security\Http\Firewall.php:66
31. Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener->onSuccess() project_path\vendor\symfony\symfony\src\Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener.php:143
32. Symfony\Component\ClassLoader\DebugClassLoader->loadClass() project_path\vendor\symfony\symfony\src\Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener.php:0
33. Symfony\Component\ClassLoader\DebugClassLoader->findFile() project_path\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\DebugClassLoader.php:95
...
Before I've upgraded all tests worked fine, now they throw that error when using:
$form = $crawler->selectButton('Login')->form();
$form['_password'] = '123ASDasd';
$form['_username'] = 'MattKing';
$crawler = $client->submit($form); //this is LoginControllerTest.php:53 from error above
or
$link = $crawler->selectLink('Matt King')->link();
$client->click($link); // --> error
or
$client = static::createClient();
$client->followRedirects(true);
$crawler = $client->request('GET', '/login'); // --> error
Another problem was while using default symfony translations functions. After switching user's locale - test threw same error as above. When I commented out switching locale, then the others error (like the one above) occured. Notice it might have been caused by same issues as above.
I've searched for reason for few days and gave up. Any idea how to fix this?