Add fragment processing. This will temporarily fix our PHP template inclusion woes.
[xhtml-compiler.git] / tests / index.php
blob2d6fbf0bad0af792991e03becac28d8de49ec8e8
1 <?php
3 // call one file using /?f=FileTest.php , see $test_files array for
4 // valid values
6 error_reporting(E_ALL | E_STRICT);
7 define('XHTMLCompilerTest', 1);
9 $simpletest_location = 'simpletest/'; // reasonable guess
11 // load SimpleTest
12 @include '../config-test.php'; // don't mind if it isn't there
13 require_once $simpletest_location . 'unit_tester.php';
14 require_once $simpletest_location . 'reporter.php';
15 require_once $simpletest_location . 'mock_objects.php';
17 // note we are using a specially modded version of SimpleTest with strict
18 // support as well as a backported fix in exceptions.php that
19 // ensures tearDown gets called
21 // load our libraries
22 require_once '../common.php';
23 chdir('xhtml-compiler/tests');
24 Mock::generate('XHTMLCompiler', 'XHTMLCompilerMock');
25 Mock::generate('XHTMLCompiler_PHP', 'XHTMLCompiler_PHPMock');
26 Mock::generate('XHTMLCompiler_DOMFilter', 'XHTMLCompiler_DOMFilterMock');
27 Mock::generate('XHTMLCompiler_TextFilter', 'XHTMLCompiler_TextFilterMock');
28 Mock::generate('XHTMLCompiler_Page', 'XHTMLCompiler_PageMock');
30 require_once 'XHTMLCompilerHarness.php';
31 require_once 'XHTMLCompiler/FileSystemHarness.php';
33 $test = new GroupTest('All Tests - XHTML Compiler');
35 $test->addTestFile('XHTMLCompiler/FunctionsTest.php');
36 $test->addTestFile('XHTMLCompiler/PageTest.php');
37 $test->addTestFile('XHTMLCompiler/ExceptionTest.php');
38 $test->addTestFile('XHTMLCompiler/FilterManagerTest.php');
39 $test->addTestFile('XHTMLCompiler/DirectoryTest.php');
41 //if (isset($_GET['full'])) {
42 // these are expensive unit tests
43 $test->addTestFile('XHTMLCompiler/FileTest.php');
44 //}
46 if (SimpleReporter::inCli()) $reporter = new TextReporter();
47 else $reporter = new HTMLReporter('UTF-8');
49 $test->run($reporter);