From 79e5cd4543bcdca4e77219e18362d93b7f8a3475 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 1 Aug 2006 00:18:22 +0000 Subject: [PATCH] Augment test file so we can run from cli. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@137 48356398-32a2-884e-a903-53898d9a118a --- tests/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/index.php b/tests/index.php index 1c152605..21ab870e 100644 --- a/tests/index.php +++ b/tests/index.php @@ -2,6 +2,7 @@ error_reporting(E_ALL); +// load files, assume that simpletest directory is in path require_once 'simpletest/unit_tester.php'; require_once 'simpletest/reporter.php'; require_once 'simpletest/mock_objects.php'; @@ -37,6 +38,9 @@ $test->addTestFile('HTMLPurifier/AttrDef/EnumTest.php'); $test->addTestFile('HTMLPurifier/AttrDef/IDTest.php'); $test->addTestFile('HTMLPurifier/IDAccumulatorTest.php'); -$test->run( new HtmlReporter() ); +if (SimpleReporter::inCli()) $reporter = new TextReporter(); +else $reporter = new HTMLReporter(); + +$test->run($reporter); ?> \ No newline at end of file