-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
You cannot serialize or unserialize PDO instances #1171
Comments
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
|
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,
PHPUnit_Framework_Exception: PHP Fatal error: Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in C:\Users\php52\AppD
ata\Local\Temp\PHPB2A7.tmp:49
Stack trace:
#0 [internal function]: PDO->__sleep()
When backupStaticAttributes is enable, static data from a first test case leaks to the subsequent tests cases #1 C:\Users\php52\AppData\Local\Temp\PHPB2A7.tmp(49): serialize(Array)
Running with --process-isolation yields parse error on global data with single quotes #2 C:\Users\php52\AppData\Local\Temp\PHPB2A7.tmp(160): __phpunit_run_isolated_test()
Mocking class Imagick of pecl/imagick 3.0.0 fails with PHPUnit 3.4.2 and 3.5 beta1 #3 -(1): require_once('C:\Users\php52...')
phpunit.bat on 3.5.0RC1 doesn't work #4 {main}
thrown in C:\Users\php52\AppData\Local\Temp\PHPB2A7.tmp on line 49
Thanks
The text was updated successfully, but these errors were encountered: