0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-08 14:58:42 +00:00

- Make suite flush remote tests

- Make CliTestCase report fails when XML cannot be parsed

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1566 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-02-18 03:35:27 +00:00
parent 21cf2c94d4
commit ed2aa44bd2
2 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class CliTestCase
$xml = shell_exec($command);
if (! $xml) {
if (!$this->_quiet) {
trigger_error('Command did not have any output [' . $command . ']');
$reporter->paintFail('Command did not have any output [' . $command . ']');
}
return false;
}
@ -45,14 +45,14 @@ class CliTestCase
if (!$this->_quiet) {
foreach ($this->_errors as $error) {
list($no, $str, $file, $line) = $error;
$reporter->paintFormattedMessage("Error $no: $str on line $line of $file");
$reporter->paintFail("Error $no: $str on line $line of $file");
}
$msg = "Command produced malformed XML: \n";
if (strlen($xml) > 120) {
$msg .= substr($xml, 0, 50) . "...\n\n[snip]\n\n..." . substr($xml, -50);
$msg = substr($xml, 0, 50) . "...\n\n[snip]\n\n..." . substr($xml, -50);
} else {
$msg .= $xml;
$msg = $xml;
}
$reporter->paintFail("Command produced malformed XML");
$reporter->paintFormattedMessage($msg);
}
return false;

View File

@ -106,7 +106,7 @@ foreach ($versions_to_test as $version) {
// This is the HTML Purifier website's test XML file. We could
// 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'));
$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();