PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Dec 11, 2017 7:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Nov 28, 2012 11:02 am 
Offline
DevNet Master
User avatar

Joined: Wed Jun 27, 2007 9:44 am
Posts: 4302
Location: Sofia, Bulgaria
Hi all :)

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

_________________
There are 10 types of people in this world, those who understand binary and those who don't


Top
 Profile  
 
PostPosted: Tue Jul 02, 2013 7:15 pm 
Offline
DevNet Master

Joined: Wed Feb 11, 2004 4:23 pm
Posts: 4872
Location: Palm beach, Florida
Personally I'd just alter the low level DB object to delegate to your new more robust DB object. Testing legacy code without modifying it isn't always possible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group