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

[3.1.0] When flush fails, fail SimpleTest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1641 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-04-03 21:24:16 +00:00
parent 1d25be875d
commit e78df4dc9f
5 changed files with 53 additions and 27 deletions

View File

@@ -46,10 +46,15 @@ $aliases = array(
);
htmlpurifier_parse_args($AC, $aliases);
// Regenerate any necessary files
shell_exec($AC['php'] . ' ../maintenance/flush.php');
if ($AC['xml']) {
$reporter = new XmlReporter();
} else {
$reporter = new TextReporter();
}
// Regenerate any necessary files
htmlpurifier_flush($AC['php'], $reporter);
$test = new TestSuite('HTML Purifier Multiple Versions Test');
$file = '';
$test_files = array();
@@ -59,13 +64,14 @@ if ($AC['file']) {
if (isset($test_files_lookup[$AC['file']])) {
$file = '--file=' . $AC['file'];
} else {
echo "Invalid file passed\n";
exit;
throw new Exception("Invalid file passed");
}
}
// This allows us to get out of having to do dry runs.
$size = count($test_files);
// Setup the test
$test = new TestSuite('HTML Purifier Multiple Versions Test');
foreach ($versions_to_test as $version) {
$flush = '';
if (is_array($version)) {
@@ -104,11 +110,6 @@ foreach ($versions_to_test as $version) {
// add more websites, i.e. more configurations to test.
$test->addTestCase(new RemoteTestCase('http://htmlpurifier.org/dev/tests/?xml=1', 'http://htmlpurifier.org/dev/tests/?xml=1&dry=1&flush=1'));
if ($AC['xml']) {
$reporter = new XmlReporter();
} else {
$reporter = new TextReporter();
}
$test->run($reporter);
shell_exec($AC['php'] . ' ../maintenance/flush-definition-cache.php');