mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +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:
parent
d1ace6af17
commit
3b5effcb72
@ -40,9 +40,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
|
|||||||
$result = $def->validate($input, $config, $context);
|
$result = $def->validate($input, $config, $context);
|
||||||
$this->assertIdentical($output, $result);
|
$this->assertIdentical($output, $result);
|
||||||
|
|
||||||
$def1->tally();
|
|
||||||
$def2->tally();
|
|
||||||
|
|
||||||
// second test, first def fails, second def works
|
// second test, first def fails, second def works
|
||||||
|
|
||||||
$def1 = new HTMLPurifier_AttrDefMock();
|
$def1 = new HTMLPurifier_AttrDefMock();
|
||||||
@ -60,9 +57,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
|
|||||||
$result = $def->validate($input, $config, $context);
|
$result = $def->validate($input, $config, $context);
|
||||||
$this->assertIdentical($output, $result);
|
$this->assertIdentical($output, $result);
|
||||||
|
|
||||||
$def1->tally();
|
|
||||||
$def2->tally();
|
|
||||||
|
|
||||||
// third test, all fail, so composite faiils
|
// third test, all fail, so composite faiils
|
||||||
|
|
||||||
$def1 = new HTMLPurifier_AttrDefMock();
|
$def1 = new HTMLPurifier_AttrDefMock();
|
||||||
@ -80,9 +74,6 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
|
|||||||
$result = $def->validate($input, $config, $context);
|
$result = $def->validate($input, $config, $context);
|
||||||
$this->assertIdentical($output, $result);
|
$this->assertIdentical($output, $result);
|
||||||
|
|
||||||
$def1->tally();
|
|
||||||
$def2->tally();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,6 @@ extends HTMLPurifier_ChildDefHarness
|
|||||||
$this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p');
|
$this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p');
|
||||||
$this->config->set('HTML', 'BlockWrapper', 'dav');
|
$this->config->set('HTML', 'BlockWrapper', 'dav');
|
||||||
$this->assertResult('Needs wrap', '<p>Needs wrap</p>');
|
$this->assertResult('Needs wrap', '<p>Needs wrap</p>');
|
||||||
$this->swallowErrors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness
|
|||||||
"\xF6", // this is invalid
|
"\xF6", // this is invalid
|
||||||
'Expected identical [Binary: F6]'
|
'Expected identical [Binary: F6]'
|
||||||
);
|
);
|
||||||
$this->assertNoErrors();
|
|
||||||
|
|
||||||
$config = HTMLPurifier_Config::create(array(
|
$config = HTMLPurifier_Config::create(array(
|
||||||
'Core.Encoding' => 'ISO-8859-1'
|
'Core.Encoding' => 'ISO-8859-1'
|
||||||
|
@ -25,14 +25,14 @@ class HTMLPurifier_ErrorCollectorEMock extends HTMLPurifier_ErrorCollectorMock
|
|||||||
|
|
||||||
public function send($v1, $v2) {
|
public function send($v1, $v2) {
|
||||||
// test for context
|
// test for context
|
||||||
$context =& SimpleTest::getContext();
|
$context = SimpleTest::getContext();
|
||||||
$test =& $context->getTest();
|
$test = $context->getTest();
|
||||||
|
|
||||||
// compat
|
// compat
|
||||||
if (empty($this->_mock)) {
|
if (empty($this->_mock)) {
|
||||||
$mock =& $this;
|
$mock = $this;
|
||||||
} else {
|
} else {
|
||||||
$mock =& $this->_mock;
|
$mock = $this->_mock;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->_expected_context as $key => $value) {
|
foreach ($this->_expected_context as $key => $value) {
|
||||||
|
@ -111,10 +111,6 @@ class HTMLPurifier_HTMLModule_TidyTest extends HTMLPurifier_Harness
|
|||||||
)));
|
)));
|
||||||
$module->construct($config);
|
$module->construct($config);
|
||||||
|
|
||||||
// done
|
|
||||||
|
|
||||||
$module->tally();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_makeFixesForLevel() {
|
function test_makeFixesForLevel() {
|
||||||
|
@ -59,12 +59,6 @@ class HTMLPurifier_Strategy_CompositeTest extends HTMLPurifier_Harness
|
|||||||
$output = $composite->execute($input_1, $config, $context);
|
$output = $composite->execute($input_1, $config, $context);
|
||||||
$this->assertIdentical($input_4, $output);
|
$this->assertIdentical($input_4, $output);
|
||||||
|
|
||||||
// tally the calls
|
|
||||||
|
|
||||||
$mock_1->tally();
|
|
||||||
$mock_2->tally();
|
|
||||||
$mock_3->tally();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,6 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness
|
|||||||
$this->config->set('HTML', 'Parent', 'obviously-impossible');
|
$this->config->set('HTML', 'Parent', 'obviously-impossible');
|
||||||
// $this->expectError('Cannot use unrecognized element as parent');
|
// $this->expectError('Cannot use unrecognized element as parent');
|
||||||
$this->assertResult('<div>Accept</div>');
|
$this->assertResult('<div>Accept</div>');
|
||||||
$this->swallowErrors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testCascadingRemovalOfNodesMissingRequiredChildren() {
|
function testCascadingRemovalOfNodesMissingRequiredChildren() {
|
||||||
|
@ -152,12 +152,12 @@ function htmlpurifier_args(&$AC, $aliases, $o, $v) {
|
|||||||
function htmlpurifier_add_test($test, $test_file, $only_phpt = false) {
|
function htmlpurifier_add_test($test, $test_file, $only_phpt = false) {
|
||||||
switch (strrchr($test_file, ".")) {
|
switch (strrchr($test_file, ".")) {
|
||||||
case '.phpt':
|
case '.phpt':
|
||||||
return $test->addTestCase(new PHPT_Controller_SimpleTest($test_file));
|
return $test->add(new PHPT_Controller_SimpleTest($test_file));
|
||||||
case '.php':
|
case '.php':
|
||||||
require_once $test_file;
|
require_once $test_file;
|
||||||
return $test->addTestClass(path2class($test_file));
|
return $test->add(path2class($test_file));
|
||||||
case '.vtest':
|
case '.vtest':
|
||||||
return $test->addTestCase(new HTMLPurifier_ConfigSchema_ValidatorTestCase($test_file));
|
return $test->add(new HTMLPurifier_ConfigSchema_ValidatorTestCase($test_file));
|
||||||
default:
|
default:
|
||||||
trigger_error("$test_file is an invalid file for testing", E_USER_ERROR);
|
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.
|
* Dumps error queue, useful if there has been a fatal error.
|
||||||
*/
|
*/
|
||||||
function htmlpurifier_dump_error_queue() {
|
function htmlpurifier_dump_error_queue() {
|
||||||
$context = &SimpleTest::getContext();
|
$context = SimpleTest::getContext();
|
||||||
$queue = &$context->get('SimpleErrorQueue');
|
$queue = $context->get('SimpleErrorQueue');
|
||||||
if ($queue && !empty($queue->_queue)) {
|
if ($queue && !empty($queue->_queue)) {
|
||||||
// replace this with something prettier
|
// replace this with something prettier
|
||||||
var_dump($queue->_queue);
|
var_dump($queue->_queue);
|
||||||
|
Loading…
Reference in New Issue
Block a user