mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-09 15:28:40 +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:
parent
21cf2c94d4
commit
ed2aa44bd2
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user