1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

[3.1.0] Implement a few phpt, fix some autoload bugs

- Make our autoload handler polite, ensuring that any __autoload() 
functions get added
- Modify phpt calling code so that each phpt files gets its own 
test-case (this lets us run one phpt file at a time)
- Implement phpt for loading, which test varying loading methods of HTML 
Purifier
- Add --disable-phpt and --only-phpt flags
- More descriptive veto messages, also fix test count



git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1552 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-02-16 05:40:59 +00:00
parent 3441421e8b
commit 929d932234
10 changed files with 123 additions and 15 deletions

View File

@@ -120,12 +120,14 @@ function htmlpurifier_args(&$AC, $aliases, $o, $v) {
* Adds a test-class; depending on the file's extension this may involve
* a regular UnitTestCase or a special PHPT test
*/
function htmlpurifier_add_test($test, $test_file) {
$info = pathinfo($test_file);
if (!isset($info['extension']) || $info['extension'] == 'phpt') {
$test->addTestCase(new PHPT_Controller_SimpleTest($test_file));
} else {
require_once $test_file;
$test->addTestClass(path2class($test_file));
function htmlpurifier_add_test($test, $test_file, $only_phpt = false) {
switch (strrchr($test_file, ".")) {
case '.phpt':
return $test->addTestCase(new PHPT_Controller_SimpleTest($test_file));
case '.php':
require_once $test_file;
return $test->addTestClass(path2class($test_file));
default:
trigger_error("$test_file is an invalid file for testing", E_USER_ERROR);
}
}