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....
Building acceptence tests and more DB thoughts
Moderator: General Moderators
Rather than using inheritance, instantiate a "DatabaseUnitTestCase" object in the test case:
..and call sandbox setUp/tearDown in the test case setUp/tearDown methods.
Inheritance often leads you into problems exactly like this one.
Code: Select all
$this->sandbox =& new DatabaseSandbox;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).McGruff wrote:Rather than using inheritance, instantiate a "DatabaseUnitTestCase" object in the test case:
..and call sandbox setUp/tearDown in the test case setUp/tearDown methods.Code: Select all
$this->sandbox =& new DatabaseSandbox;
Inheritance often leads you into problems exactly like this one.