Location: PHPKode > projects > SolarPHP > solar-system-1.1.1/solar/source/solar/Solar/Test/Suite/run-test.php
// load this test class
$class = $_SERVER['argv'][1];

// run this test method in the class
$method = $_SERVER['argv'][2];

// test instance
$test = new $class();

// set the error handler for the test
set_error_handler(array($test, 'error'));

// even though the handler deals with errors (and does not
// print them), we still want error display turned on,
// because the error handler **does not** catch fatal
// errors.
ini_set('display_errors', true);

// run the test
try {
    // even if we get through the method, it should have made at least one
    // assertion. if not, nothing was actually "tested".
    if (! $test->getAssertCount()) {
        $test->todo('made no assertions');
} catch (Exception $e) {
    // output the exception as diagnostic info
    // clean up
    // how to exit?
    if ($e instanceof Solar_Test_Exception) {
        // this is an "exit" exception
        $info = $e->getInfo();
        exit((int) $info['exit']);
    } else {
        // unknown exception, call it premature termination

// pass
Return current item: SolarPHP