mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 08:21: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:
parent
ed2aa44bd2
commit
f5a77c523b
1
TODO
1
TODO
@ -19,7 +19,6 @@ IMPORTANT
|
|||||||
- Release candidate, because of the major changes
|
- Release candidate, because of the major changes
|
||||||
- Move utility classes for ConfigSchema into HTML Purifier itself: they're
|
- Move utility classes for ConfigSchema into HTML Purifier itself: they're
|
||||||
that important
|
that important
|
||||||
- Allow unit tests to be run w/o PHPT
|
|
||||||
|
|
||||||
DOCUMENTATION
|
DOCUMENTATION
|
||||||
- Document new ConfigSchema setup and format; dev-includes.txt is a base
|
- Document new ConfigSchema setup and format; dev-includes.txt is a base
|
||||||
|
@ -4,20 +4,32 @@
|
|||||||
// This file is necessary to run the unit tests and profiling scripts.
|
// This file is necessary to run the unit tests and profiling scripts.
|
||||||
// Please copy it to 'test-settings.php' and make the necessary edits.
|
// 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
|
// Note: The minimum set of external libraries you need are PHP SimpleTest
|
||||||
// turn off the time limit
|
|
||||||
|
// We've got a lot of tests, so we recommend turning the limit off.
|
||||||
set_time_limit(0);
|
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();
|
$data = @ob_get_clean();
|
||||||
if ($data !== false && $data !== '') {
|
if ($data !== false && $data !== '') {
|
||||||
echo "Output buffer contains data [".urlencode($data)."]\n";
|
echo "Output buffer contains data [".urlencode($data)."]\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// RECOMMENDED SETTINGS
|
||||||
|
|
||||||
// Where is SimpleTest located?
|
// Where is SimpleTest located?
|
||||||
$simpletest_location = '/path/to/simpletest/';
|
$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?
|
// Where is CSSTidy located?
|
||||||
$csstidy_location = '/path/to/csstidy/';
|
$csstidy_location = '/path/to/csstidy/';
|
||||||
|
|
||||||
@ -31,7 +43,7 @@ $php = 'php';
|
|||||||
// accept an extra parameter (version number) before all other arguments
|
// accept an extra parameter (version number) before all other arguments
|
||||||
$phpv = 'phpv';
|
$phpv = 'phpv';
|
||||||
|
|
||||||
// How many times should profiling scripts iterate over the function? More runs
|
// Should PEAR tests be run? If you've got a valid PEAR installation, set this
|
||||||
// means more accurate results, but they'll take longer to perform.
|
// to true (or, if it's not in the include path, to its install directory).
|
||||||
$GLOBALS['HTMLPurifierTest']['Runs'] = 2;
|
$GLOBALS['HTMLPurifierTest']['PEAR'] = false;
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ if (function_exists('spl_autoload_register')) {
|
|||||||
// default settings (protect against register_globals)
|
// default settings (protect against register_globals)
|
||||||
$GLOBALS['HTMLPurifierTest'] = array();
|
$GLOBALS['HTMLPurifierTest'] = array();
|
||||||
$GLOBALS['HTMLPurifierTest']['PEAR'] = false; // do PEAR tests
|
$GLOBALS['HTMLPurifierTest']['PEAR'] = false; // do PEAR tests
|
||||||
|
$GLOBALS['HTMLPurifierTest']['PHPT'] = true; // do PHPT tests
|
||||||
$GLOBALS['HTMLPurifierTest']['PH5P'] = class_exists('DOMDocument');
|
$GLOBALS['HTMLPurifierTest']['PH5P'] = class_exists('DOMDocument');
|
||||||
|
|
||||||
// default library settings
|
// default library settings
|
||||||
|
@ -40,6 +40,9 @@ $aliases = array(
|
|||||||
// with a function, but could be if we put this in a class.
|
// with a function, but could be if we put this in a class.
|
||||||
htmlpurifier_parse_args($AC, $aliases);
|
htmlpurifier_parse_args($AC, $aliases);
|
||||||
|
|
||||||
|
// Disable PHPT tests if they're not enabled
|
||||||
|
if (!$GLOBALS['HTMLPurifierTest']['PHPT']) $AC['disable-phpt'] = true;
|
||||||
|
|
||||||
if (!SimpleReporter::inCli()) {
|
if (!SimpleReporter::inCli()) {
|
||||||
// Undo any dangerous parameters
|
// Undo any dangerous parameters
|
||||||
$AC['php'] = $php;
|
$AC['php'] = $php;
|
||||||
|
Loading…
Reference in New Issue
Block a user