lines 512 through 520 of test_unit.php read:
function add($test_case) {
if (! is_string($test_case)) {
$this->test_cases[] = $test_case;
} elseif (TestSuite::getBaseTestCase($test_case) == 'testsuite') {
$this->test_cases[] = new $test_case();
} else {
$this->test_cases[] = $test_case;
}
}
The middle test is dead because an object !is_string().
It works as is, so maybe the middle code isn't needed?
Logged In: YES
user_id=1046384
Originator: NO
I disagree with 'works as is'.
In my environment simpletest seems to have problems handling references properly (and others).
$suite->add('MyTest');
results in: Call to a member function getSize() on a non-object
and this:
$suite->add($test1);
$suite->add($test2);
will execute the first test twice.
All this using PHP5.2.6!
So, what works for me is actually to use the deprecated method $suite->addTestClass('MyTest');
mano