=')) { $test_files[] = 'TokenFactoryTest.php'; } $test_file_lookup = array_flip($test_files); function htmlpurifier_path2class($path) { $temp = $path; $temp = str_replace('./', '', $temp); // remove leading './' $temp = str_replace('.\\', '', $temp); // remove leading '.\' $temp = str_replace('\\', '_', $temp); // normalize \ to _ $temp = str_replace('/', '_', $temp); // normalize / to _ while(strpos($temp, '__') !== false) $temp = str_replace('__', '_', $temp); $temp = str_replace('.php', '', $temp); return $temp; } // we can't use addTestFile because SimpleTest chokes on E_STRICT warnings if (isset($_GET['file']) && isset($test_file_lookup[$_GET['file']])) { // execute only one test $test_file = $_GET['file']; $test = new GroupTest('HTMLPurifier - ' . $test_file); $path = 'HTMLPurifier/' . $test_file; require_once $path; $test->addTestClass(htmlpurifier_path2class($path)); } else { $test = new GroupTest('HTMLPurifier'); foreach ($test_files as $test_file) { $path = 'HTMLPurifier/' . $test_file; require_once $path; $test->addTestClass(htmlpurifier_path2class($path)); } } if (SimpleReporter::inCli()) $reporter = new TextReporter(); else $reporter = new HTMLReporter(); $test->run($reporter); ?>