0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-19 10:45:18 +00:00

- Removed tally(), swallowErrors(), assertNoErrors()

- Removed unnecessary ampersands

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1657 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-04-14 03:06:36 +00:00
parent d1ace6af17
commit 3b5effcb72
8 changed files with 9 additions and 31 deletions

View File

@ -40,9 +40,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
$result = $def->validate($input, $config, $context);
$this->assertIdentical($output, $result);
$def1->tally();
$def2->tally();
// second test, first def fails, second def works
$def1 = new HTMLPurifier_AttrDefMock();
@ -60,9 +57,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
$result = $def->validate($input, $config, $context);
$this->assertIdentical($output, $result);
$def1->tally();
$def2->tally();
// third test, all fail, so composite faiils
$def1 = new HTMLPurifier_AttrDefMock();
@ -80,9 +74,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
$result = $def->validate($input, $config, $context);
$this->assertIdentical($output, $result);
$def1->tally();
$def2->tally();
}
}

View File

@ -75,7 +75,6 @@ extends HTMLPurifier_ChildDefHarness
$this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p');
$this->config->set('HTML', 'BlockWrapper', 'dav');
$this->assertResult('Needs wrap', '<p>Needs wrap</p>');
$this->swallowErrors();
}
}

View File

@ -36,7 +36,6 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness
"\xF6", // this is invalid
'Expected identical [Binary: F6]'
);
$this->assertNoErrors();
$config = HTMLPurifier_Config::create(array(
'Core.Encoding' => 'ISO-8859-1'

View File

@ -25,14 +25,14 @@ class HTMLPurifier_ErrorCollectorEMock extends HTMLPurifier_ErrorCollectorMock
public function send($v1, $v2) {
// test for context
$context =& SimpleTest::getContext();
$test =& $context->getTest();
$context = SimpleTest::getContext();
$test = $context->getTest();
// compat
if (empty($this->_mock)) {
$mock =& $this;
$mock = $this;
} else {
$mock =& $this->_mock;
$mock = $this->_mock;
}
foreach ($this->_expected_context as $key => $value) {

View File

@ -111,10 +111,6 @@ class HTMLPurifier_HTMLModule_TidyTest extends HTMLPurifier_Harness
)));
$module->construct($config);
// done
$module->tally();
}
function test_makeFixesForLevel() {

View File

@ -59,12 +59,6 @@ class HTMLPurifier_Strategy_CompositeTest extends HTMLPurifier_Harness
$output = $composite->execute($input_1, $config, $context);
$this->assertIdentical($input_4, $output);
// tally the calls
$mock_1->tally();
$mock_2->tally();
$mock_3->tally();
}
}

View File

@ -108,7 +108,6 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness
$this->config->set('HTML', 'Parent', 'obviously-impossible');
// $this->expectError('Cannot use unrecognized element as parent');
$this->assertResult('<div>Accept</div>');
$this->swallowErrors();
}
function testCascadingRemovalOfNodesMissingRequiredChildren() {

View File

@ -152,12 +152,12 @@ function htmlpurifier_args(&$AC, $aliases, $o, $v) {
function htmlpurifier_add_test($test, $test_file, $only_phpt = false) {
switch (strrchr($test_file, ".")) {
case '.phpt':
return $test->addTestCase(new PHPT_Controller_SimpleTest($test_file));
return $test->add(new PHPT_Controller_SimpleTest($test_file));
case '.php':
require_once $test_file;
return $test->addTestClass(path2class($test_file));
return $test->add(path2class($test_file));
case '.vtest':
return $test->addTestCase(new HTMLPurifier_ConfigSchema_ValidatorTestCase($test_file));
return $test->add(new HTMLPurifier_ConfigSchema_ValidatorTestCase($test_file));
default:
trigger_error("$test_file is an invalid file for testing", E_USER_ERROR);
}
@ -213,8 +213,8 @@ function htmlpurifier_flush($php, $reporter) {
* Dumps error queue, useful if there has been a fatal error.
*/
function htmlpurifier_dump_error_queue() {
$context = &SimpleTest::getContext();
$queue = &$context->get('SimpleErrorQueue');
$context = SimpleTest::getContext();
$queue = $context->get('SimpleErrorQueue');
if ($queue && !empty($queue->_queue)) {
// replace this with something prettier
var_dump($queue->_queue);