This has something to do with PHPUnit for backing up global variables and static attributes between each test. If you have a PDO instance, it breaks up when you try to serialize. I ran into a similar problem, and I could not find where the PDO instance was saved as a global parameter, but disconnected backupGlobals and backupStaticAttributes in the right check, it helped.
class SearchControllerTest extends \Majisti\Test\TestCase { ... }
source: http://sebastian-bergmann.de/archives/797-Global-Variables-and-PHPUnit.html
source share