mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-26 15:25:04 +02:00
Rewire test runner to use full path to test file, this means we can introduce new namespaces.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1102 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -38,8 +38,7 @@ if ( is_string($GLOBALS['HTMLPurifierTest']['PEAR']) ) {
|
||||
}
|
||||
|
||||
// initialize and load HTML Purifier
|
||||
set_include_path('../library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once 'HTMLPurifier.php';
|
||||
require_once '../library/HTMLPurifier.auto.php';
|
||||
|
||||
// load tests
|
||||
$test_files = array();
|
||||
@@ -61,19 +60,17 @@ if (isset($_GET['f']) && isset($test_file_lookup[$_GET['f']])) {
|
||||
// we can't use addTestFile because SimpleTest chokes on E_STRICT warnings
|
||||
if ($test_file = $GLOBALS['HTMLPurifierTest']['File']) {
|
||||
|
||||
$test = new GroupTest($test_file . ' - HTML Purifier');
|
||||
$path = 'HTMLPurifier/' . $test_file;
|
||||
require_once $path;
|
||||
$test->addTestClass(path2class($path));
|
||||
$test = new GroupTest($test_file);
|
||||
require_once $test_file;
|
||||
$test->addTestClass(path2class($test_file));
|
||||
|
||||
} else {
|
||||
|
||||
$test = new GroupTest('All Tests - HTML Purifier');
|
||||
$test = new GroupTest('All Tests');
|
||||
|
||||
foreach ($test_files as $test_file) {
|
||||
$path = 'HTMLPurifier/' . $test_file;
|
||||
require_once $path;
|
||||
$test->addTestClass(path2class($path));
|
||||
require_once $test_file;
|
||||
$test->addTestClass(path2class($test_file));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user