0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-09 15:28:40 +00:00

[3.1.0] Get testing working again for all versions

- Standalone testing setup properly with autoload
- Bootstrap autoloader deals more robustly with classes that don't exist, preventing class_exists($class, true) from barfing.
- Cleanup $_reporter to $reporter

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1727 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-05-16 01:49:33 +00:00
parent ef6a1c9274
commit 0bef016271
5 changed files with 13 additions and 8 deletions

3
NEWS
View File

@ -34,6 +34,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
! %HTML.Allowed deals gracefully with whitespace anywhere, anytime!
! HTML Purifier's URI handling is a lot more robust, with much stricter
validation checks and better percent encoding handling.
! Bootstrap autoloader deals more robustly with classes that don't exist,
preventing class_exists($class, true) from barfing.
- InterchangeBuilder now alphabetizes its lists
- Validation error in configdoc output fixed
- Iconv and other encoding errors muted even with custom error handlers that
@ -50,6 +52,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
- Fatal error with unserialization of ScriptRequired
- Created directories are now chmod'ed properly
- Fixed bug with fallback languages in LanguageFactory
- Standalone testing setup properly with autoload
. Out-of-date documentation revised
. UTF-8 encoding check optimization as suggested by Diego
. HTMLPurifier_Error removed in favor of exceptions

View File

@ -172,7 +172,7 @@
</directive>
<directive id="Core.Language">
<file name="HTMLPurifier/LanguageFactory.php">
<line>85</line>
<line>88</line>
</file>
</directive>
<directive id="Core.LexerImpl">

View File

@ -37,7 +37,7 @@ class HTMLPurifier_Bootstrap
public static function autoload($class) {
$file = HTMLPurifier_Bootstrap::getPath($class);
if (!$file) return false;
require $file;
require HTMLPURIFIER_PREFIX . '/' . $file;
return true;
}
@ -49,10 +49,12 @@ class HTMLPurifier_Bootstrap
// Custom implementations
if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) {
$code = str_replace('_', '-', substr($class, 22));
return 'HTMLPurifier/Language/classes/' . $code . '.php';
$file = 'HTMLPurifier/Language/classes/' . $code . '.php';
} else {
$file = str_replace('_', '/', $class) . '.php';
}
// Standard implementation
return str_replace('_', '/', $class) . '.php';
if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) return false;
return $file;
}
/**

View File

@ -193,7 +193,7 @@ class FailedTest extends UnitTestCase {
}
public function test() {
$this->fail($this->msg);
if ($this->details) $this->_reporter->paintFormattedMessage($this->details);
if ($this->details) $this->reporter->paintFormattedMessage($this->details);
}
}

View File

@ -85,8 +85,8 @@ if ($AC['standalone']) {
} else {
require '../library/HTMLPurifier.path.php';
require 'HTMLPurifier.includes.php';
require '../library/HTMLPurifier.autoload.php';
}
require '../library/HTMLPurifier.autoload.php';
require 'HTMLPurifier/Harness.php';
// Now, userland code begins to be executed