PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Jun 25, 2018 6:32 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sun Aug 07, 2005 8:11 pm 
Offline
DevNet Resident
User avatar

Joined: Fri Aug 16, 2002 8:57 am
Posts: 1834
Location: Watertown, MA
Back to the database unit/web subclasses.

I need the similar subclass in both unit and web trees. Is there any non-repetitive way to subclass both with the same additions? (Short of hacking the simpletest base classes)

I tried to migrate the common code out to an include file and then include that file within the body of the class, but tha's not allowed syntacicly....


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 07, 2005 9:39 pm 
Offline
DevNet Master

Joined: Thu Jan 30, 2003 9:26 pm
Posts: 2893
Location: Glasgow, Scotland
Rather than using inheritance, instantiate a "DatabaseUnitTestCase" object in the test case:

Syntax: [ Download ] [ Hide ]
$this->sandbox =& new DatabaseSandbox;


..and call sandbox setUp/tearDown in the test case setUp/tearDown methods.

Inheritance often leads you into problems exactly like this one.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 1:10 pm 
Offline
DevNet Resident
User avatar

Joined: Fri Aug 16, 2002 8:57 am
Posts: 1834
Location: Watertown, MA
McGruff wrote:
Rather than using inheritance, instantiate a "DatabaseUnitTestCase" object in the test case:

Syntax: [ Download ] [ Hide ]
$this->sandbox =& new DatabaseSandbox;


..and call sandbox setUp/tearDown in the test case setUp/tearDown methods.

Inheritance often leads you into problems exactly like this one.


I had started with that but it wasn't working. I think I can go back to it now that I've identified the other "hidden" method calls for setting up some test cases (inlining parts of invoke/run).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB® Forum Software © phpBB Group