From 3b5effcb725e9c417516aa9b25473335f7994aad Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 14 Apr 2008 03:06:36 +0000 Subject: [PATCH] - Removed tally(), swallowErrors(), assertNoErrors() - Removed unnecessary ampersands git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1657 48356398-32a2-884e-a903-53898d9a118a --- tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php | 9 --------- tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php | 1 - tests/HTMLPurifier/EncoderTest.php | 1 - tests/HTMLPurifier/ErrorCollectorEMock.php | 8 ++++---- tests/HTMLPurifier/HTMLModule/TidyTest.php | 4 ---- tests/HTMLPurifier/Strategy/CompositeTest.php | 6 ------ tests/HTMLPurifier/Strategy/FixNestingTest.php | 1 - tests/common.php | 10 +++++----- 8 files changed, 9 insertions(+), 31 deletions(-) diff --git a/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php b/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php index 8b5dc20e..384d39c3 100644 --- a/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php +++ b/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php @@ -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(); - } } diff --git a/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php b/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php index 53462046..60cf50f3 100644 --- a/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php +++ b/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php @@ -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', '

Needs wrap

'); - $this->swallowErrors(); } } diff --git a/tests/HTMLPurifier/EncoderTest.php b/tests/HTMLPurifier/EncoderTest.php index 2d648db8..ac35d223 100644 --- a/tests/HTMLPurifier/EncoderTest.php +++ b/tests/HTMLPurifier/EncoderTest.php @@ -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' diff --git a/tests/HTMLPurifier/ErrorCollectorEMock.php b/tests/HTMLPurifier/ErrorCollectorEMock.php index 8457b764..a2c89837 100644 --- a/tests/HTMLPurifier/ErrorCollectorEMock.php +++ b/tests/HTMLPurifier/ErrorCollectorEMock.php @@ -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) { diff --git a/tests/HTMLPurifier/HTMLModule/TidyTest.php b/tests/HTMLPurifier/HTMLModule/TidyTest.php index 66824f69..b850962d 100644 --- a/tests/HTMLPurifier/HTMLModule/TidyTest.php +++ b/tests/HTMLPurifier/HTMLModule/TidyTest.php @@ -111,10 +111,6 @@ class HTMLPurifier_HTMLModule_TidyTest extends HTMLPurifier_Harness ))); $module->construct($config); - // done - - $module->tally(); - } function test_makeFixesForLevel() { diff --git a/tests/HTMLPurifier/Strategy/CompositeTest.php b/tests/HTMLPurifier/Strategy/CompositeTest.php index 34bb214c..df95297d 100644 --- a/tests/HTMLPurifier/Strategy/CompositeTest.php +++ b/tests/HTMLPurifier/Strategy/CompositeTest.php @@ -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(); - } } diff --git a/tests/HTMLPurifier/Strategy/FixNestingTest.php b/tests/HTMLPurifier/Strategy/FixNestingTest.php index a381ce22..908ee2b4 100644 --- a/tests/HTMLPurifier/Strategy/FixNestingTest.php +++ b/tests/HTMLPurifier/Strategy/FixNestingTest.php @@ -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('
Accept
'); - $this->swallowErrors(); } function testCascadingRemovalOfNodesMissingRequiredChildren() { diff --git a/tests/common.php b/tests/common.php index 72d65b44..81a0eb9f 100644 --- a/tests/common.php +++ b/tests/common.php @@ -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); -- 2.11.4.GIT