|
From: Marcus B. <ma...@la...> - 2003-11-13 14:56:04
|
Hi...
Jason Sweat wrote:
> That looks good. Where would you define it in a test suite that was able to
> run each test file standalone? Seems like you would have to hack it into
> simpletest itself to make it universally accessable, or is there a more
> reasonable hook?
If you just want it for one test case, then just add it to that test
case. Only methods that start with the name "test" are actually run. You
can add as many other helper methods case as you want.
If you want to use it in more than one test case then do the following...
class TimerTest extends UnitTestCase {
function TimerTest() {
$this->UnitTestCase();
}
function assertNow( .. ) { ... }
}
SimpleTestOptions::ignore('TimerTest');
class SomeTests extends TimerTest {
function SomeTests() {
$this->TimerTest();
}
function testStuff() {
$this->assertNow( ... );
}
}
The ignore option tells SimpleTest not to run the test case so that it
doesn't interfere with the rest of the test suite. It would increase the
test case count for example.
> Jason
yours, Marcus
--
Marcus Baker, ma...@la..., no...@ap...
|