Hello,
when i have run using bin/phpunit -c app/ src/MyBundle/Tests/Controller/TestControllerTest.php
given me following error, i have finding many ways but not getting any solutions regarding it,
1) MyBundleTests\ControllerTestControllerTest::testJsonPutTestActionShouldModify
PHPUnit_Framework_Exception: PHP Fatal error: Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in C:\Users\php52AppD
ata\LocalTemp\PHPB2A7.tmp:49
Stack trace:
thrown in C:\Users\php52AppData\LocalTemp\PHPB2A7.tmp on line 49
Thanks
You need to disable process isolation if you want to test objects which do not support serialization (e.g. PDO objects).
@whatthejeff
You need to disable process isolation if you want to test objects which do not support serialization (e.g. PDO objects).
How to do that ?
By not turning it on :-) It is disabled by default.
Yeah I figured out ;) .Indeed in my symfony2 project it was enabled in phpunit.xml.dist
backupGlobals = "false"
processIsolation = "true"
Most helpful comment
You need to disable process isolation if you want to test objects which do not support serialization (e.g. PDO objects).