1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 06:07:26 +02:00

[1.4.0] Revamp ConfigTest.php. Factor out tallyErrors() to its own function.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@671 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-01-21 04:37:02 +00:00
parent 2293c67eec
commit f7f6fed86a
4 changed files with 174 additions and 99 deletions

View File

@@ -0,0 +1,18 @@
<?php
function tally_errors() {
// BRITTLE: relies on private code to work
$context = &SimpleTest::getContext();
$queue = &$context->get('SimpleErrorQueue');
if (!isset($queue->_expectation_queue)) return; // fut-compat
foreach ($queue->_expectation_queue as $e) {
if (count($e) != 2) return; // fut-compat
if (!isset($e[0])) return; // fut-compat
$e[0]->_dumper = &new SimpleDumper();
$this->fail('Error expectation not fulfilled: ' .
$e[0]->testMessage(null));
}
$queue->_expectation_queue = array();
}
?>