0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 00:11:52 +00:00

Make PHPT globally configurable via test-settings.php

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1567 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-02-18 03:48:07 +00:00
parent ed2aa44bd2
commit f5a77c523b
4 changed files with 22 additions and 7 deletions

1
TODO
View File

@ -19,7 +19,6 @@ IMPORTANT
- Release candidate, because of the major changes
- Move utility classes for ConfigSchema into HTML Purifier itself: they're
that important
- Allow unit tests to be run w/o PHPT
DOCUMENTATION
- Document new ConfigSchema setup and format; dev-includes.txt is a base

View File

@ -4,20 +4,32 @@
// This file is necessary to run the unit tests and profiling scripts.
// Please copy it to 'test-settings.php' and make the necessary edits.
// Some of these scripts run a long time, so it is recommended that you
// turn off the time limit
// Note: The minimum set of external libraries you need are PHP SimpleTest
// We've got a lot of tests, so we recommend turning the limit off.
set_time_limit(0);
// Turning off output buffering will prevent mysterious errors from core dumps
// Turning off output buffering will prevent mysterious errors from core dumps.
$data = @ob_get_clean();
if ($data !== false && $data !== '') {
echo "Output buffer contains data [".urlencode($data)."]\n";
exit;
}
// -----------------------------------------------------------------------------
// RECOMMENDED SETTINGS
// Where is SimpleTest located?
$simpletest_location = '/path/to/simpletest/';
// Should PHPT tests be enabled? (This should already be in your path; if it
// isn't, set it here)
// set_include_path('/path/to/phpt/Core/src' . PATH_SEPARATOR . get_include_path());
$GLOBALS['HTMLPurifierTest']['PHPT'] = true;
// -----------------------------------------------------------------------------
// OPTIONAL SETTINGS
// Where is CSSTidy located?
$csstidy_location = '/path/to/csstidy/';
@ -31,7 +43,7 @@ $php = 'php';
// accept an extra parameter (version number) before all other arguments
$phpv = 'phpv';
// How many times should profiling scripts iterate over the function? More runs
// means more accurate results, but they'll take longer to perform.
$GLOBALS['HTMLPurifierTest']['Runs'] = 2;
// Should PEAR tests be run? If you've got a valid PEAR installation, set this
// to true (or, if it's not in the include path, to its install directory).
$GLOBALS['HTMLPurifierTest']['PEAR'] = false;

View File

@ -22,6 +22,7 @@ if (function_exists('spl_autoload_register')) {
// default settings (protect against register_globals)
$GLOBALS['HTMLPurifierTest'] = array();
$GLOBALS['HTMLPurifierTest']['PEAR'] = false; // do PEAR tests
$GLOBALS['HTMLPurifierTest']['PHPT'] = true; // do PHPT tests
$GLOBALS['HTMLPurifierTest']['PH5P'] = class_exists('DOMDocument');
// default library settings

View File

@ -40,6 +40,9 @@ $aliases = array(
// with a function, but could be if we put this in a class.
htmlpurifier_parse_args($AC, $aliases);
// Disable PHPT tests if they're not enabled
if (!$GLOBALS['HTMLPurifierTest']['PHPT']) $AC['disable-phpt'] = true;
if (!SimpleReporter::inCli()) {
// Undo any dangerous parameters
$AC['php'] = $php;