2006-07-23 00:11:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
2006-08-02 02:24:03 +00:00
|
|
|
// wishlist: automated calling of this file from multiple PHP versions so we
|
|
|
|
// don't have to constantly switch around
|
|
|
|
|
2006-08-01 00:18:22 +00:00
|
|
|
// load files, assume that simpletest directory is in path
|
2006-07-23 00:11:03 +00:00
|
|
|
require_once 'simpletest/unit_tester.php';
|
|
|
|
require_once 'simpletest/reporter.php';
|
|
|
|
require_once 'simpletest/mock_objects.php';
|
|
|
|
|
|
|
|
require_once 'Debugger.php';
|
|
|
|
|
|
|
|
// emulates inserting a dir called HTMLPurifier into your class dir
|
|
|
|
set_include_path(get_include_path() . PATH_SEPARATOR . '../library');
|
|
|
|
|
2006-07-29 17:38:28 +00:00
|
|
|
// since Mocks can't be called from within test files, we need to do
|
|
|
|
// a little jumping through hoops to generate them
|
|
|
|
function generate_mock_once($name) {
|
|
|
|
$mock_name = $name . 'Mock';
|
|
|
|
if (class_exists($mock_name)) return false;
|
|
|
|
Mock::generate($name, $mock_name);
|
|
|
|
}
|
|
|
|
|
2006-07-23 00:11:03 +00:00
|
|
|
$test = new GroupTest('HTMLPurifier');
|
|
|
|
|
|
|
|
$test->addTestFile('HTMLPurifier/LexerTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/Lexer/DirectLexTest.php');
|
|
|
|
//$test->addTestFile('TokenTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/ChildDefTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/GeneratorTest.php');
|
2006-07-23 21:07:30 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/EntityLookupTest.php');
|
2006-07-24 02:49:37 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/RemoveForeignElementsTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/MakeWellFormedTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/FixNestingTest.php');
|
2006-07-29 17:38:28 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/CompositeTest.php');
|
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/CoreTest.php');
|
2006-07-30 18:37:42 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/Strategy/ValidateAttributesTest.php');
|
2006-08-04 03:13:04 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDefTest.php');
|
2006-07-30 00:54:38 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDef/EnumTest.php');
|
2006-07-30 16:35:05 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDef/IDTest.php');
|
2006-08-04 02:48:20 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDef/ClassTest.php');
|
2006-08-04 03:13:04 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDef/TextTest.php');
|
2006-08-05 01:50:13 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrDef/LangTest.php');
|
2006-07-30 15:52:25 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/IDAccumulatorTest.php');
|
2006-08-02 02:24:03 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/TagTransformTest.php');
|
2006-08-05 01:50:13 +00:00
|
|
|
$test->addTestFile('HTMLPurifier/AttrTransform/LangTest.php');
|
2006-07-23 00:11:03 +00:00
|
|
|
|
2006-08-01 00:18:22 +00:00
|
|
|
if (SimpleReporter::inCli()) $reporter = new TextReporter();
|
|
|
|
else $reporter = new HTMLReporter();
|
|
|
|
|
|
|
|
$test->run($reporter);
|
2006-07-23 00:11:03 +00:00
|
|
|
|
2006-07-21 23:27:00 +00:00
|
|
|
?>
|