From ed2aa44bd2f4d0df854e9726bd758360c4ae6722 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 18 Feb 2008 03:35:27 +0000 Subject: [PATCH] - 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 --- tests/CliTestCase.php | 10 +++++----- tests/multitest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/CliTestCase.php b/tests/CliTestCase.php index 8d9d362b..53694c77 100644 --- a/tests/CliTestCase.php +++ b/tests/CliTestCase.php @@ -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; diff --git a/tests/multitest.php b/tests/multitest.php index faf0b3a7..a0dade0a 100644 --- a/tests/multitest.php +++ b/tests/multitest.php @@ -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();