
I am having big troubles with running PHPUnit Database test cases.
If I set runTestInSeparateProcess to false and I run a single test case everything is OK. But if I run all tests then some of the tests fail because meanwhile another test has 'cleared' the test DB.
If I set runTestInSeparateProcess to true, tests passed although they are run very slowly. While it is a problem, the main problem is that in such case if a test fails, then no meaningful error message is displayed - instead, I have "serialization not allowed" error for PDO or SimpleXML objects.
I read a discussion about it and Sebastian Bergmann said:
1) if there is no process isolation, then transactions should be used
2) the "serialization not allowed" error is not an PHPUnit problem
3) DB test cases may use process isolation
None of these helps me.
1) I can not use transactions because I have legacy code and the low level DB object doesn't support nested transactions, while the tested objects use transactions.
2) and 3) I experience the problems described above
Ideas? Similar problems and solutions?
Cheers, Vlad