I'm not a SimpleTest expert, but as far as I can tell that's the constructor for the UnitTestCase class. The equivalent in PHPUnit is PHPUnit_Framework_TestCase; you create your own tests by subclassing that and defining test methods. See the PHPUnit docs on writing tests for a quick howto and more info, but briefly, this is a complete PHPUnit test:
class MyTest extends PHPUnit_Framework_TestCase {
public function testSomething {
$this->assertTrue(MyClass::getSomethingTrue());
}
}
Update: to answer the revised question, the primary way to display messages in PHPUnit is on assertion failure. Every assert*
function comes with an optional $message
argument at the end, which you can use to display a custom message when that assertion fails.
If you want to always display a message, without having to fail an assertion, then you might try a straightforward print
statement. It'll be interspersed with the test output, so this may not be the best (or nicest-looking) way of accomplishing what you want, but it'll certainly dump text to a console, which is what you seem to be asking.
If you're looking for some advanced debugging during unit-testing, you may also want to consider a logging framework of some kind (or even just a custom function that opens a file, prints to it, and closes the file again). That way, you preserve the integrity of the test output, but still get extra custom messages wherever you want them during your tests.