Ejemplo n.º 1
0
                die('Exception returned: #' . get_class($e) . ': ' . $e->getMessage() . "\n");
            }
        } else {
            // This test should generate an exception
            $expected = trim($expected);
            try {
                $out->render($view);
            } catch (Opt_Exception $e) {
                if ($expected != get_class($e)) {
                    die('Invalid exception returned: #' . get_class($e) . ', ' . $expected . " expected.\n");
                }
                return true;
            }
            die("Exception NOT returned, but should be: " . $expected . "\n");
        }
    }
    // end run();
    private function stripWs($text)
    {
        return str_replace(array("\r", "\n"), array('', ''), $text);
    }
}
// end test;
if (!file_exists($argv[1])) {
    die("The specified test does not exist!\n");
}
$test = new test();
$test->init();
if ($test->run($argv[1])) {
    die("OK\n");
}