<html> <head> <title>Test of basic test classes used in SimpleTest</title> <style type="text/css"> .pass { color: green; } .fail { color: red; } body { padding: 1em; } </style> </head> <body> <h1>Simple test script for simple test</h1> <ol> <?php // Abstract class test. // $runnable = new RunnableTest("Me"); assertion("Me" == $runnable->getLabel(), "Expected [Me] got [" . $runnable->getLabel() . "]"); $test_case = new TestCase(); $test_case->attachObserver(new TestOfTestReporter(array(null), array(true), array("stuff"))); $test_case->assertTrue(true, "stuff"); $test_case = new TestCase(); $test_case->attachObserver(new TestOfTestReporter(array(null), array(false), array("more stuff"))); $test_case->assertTrue(false, "more stuff"); // Testing group test with reporter. // $test = new GroupTest("Me again"); assertion("Me again" == $test->getLabel(), "Expected [Me again] got [" . $test->getLabel() . "]"); $test->attachObserver(new TestOfTestReporter(array("Me again", "Me again"), array(null, null), array(null, null))); $test->run(); // Build a test case. //
public static function includeVars($name) { require OPBEPATH . "tests/runnable/vars/{$name}.php"; RunnableTest::$reslist = $reslist; RunnableTest::$pricelist = $pricelist; RunnableTest::$requeriments = $requeriments; RunnableTest::$resource = $resource; RunnableTest::$CombatCaps = $CombatCaps; }
public static function includeVars($name) { require OPBEPATH . "tests" . DIRECTORY_SEPARATOR . "runnable" . DIRECTORY_SEPARATOR . "vars" . DIRECTORY_SEPARATOR . "{$name}.php"; RunnableTest::$reslist = $reslist; RunnableTest::$pricelist = $pricelist; RunnableTest::$requeriments = $requeriments; RunnableTest::$resource = $resource; RunnableTest::$CombatCaps = $CombatCaps; }