diff --git a/tests/HTMLPurifier/AttrCollectionsTest.php b/tests/HTMLPurifier/AttrCollectionsTest.php index 22cb81b4..92dcae0c 100644 --- a/tests/HTMLPurifier/AttrCollectionsTest.php +++ b/tests/HTMLPurifier/AttrCollectionsTest.php @@ -15,9 +15,9 @@ class HTMLPurifier_AttrCollectionsTest extends UnitTestCase generate_mock_once('HTMLPurifier_AttrTypes'); - $collections = new HTMLPurifier_AttrCollections_TestForConstruct($this); + $collections = new HTMLPurifier_AttrCollections_TestForConstruct(); - $types = new HTMLPurifier_AttrTypesMock($this); + $types = new HTMLPurifier_AttrTypesMock(); $modules = array(); @@ -67,7 +67,7 @@ class HTMLPurifier_AttrCollectionsTest extends UnitTestCase generate_mock_once('HTMLPurifier_AttrTypes'); - $types = new HTMLPurifier_AttrTypesMock($this); + $types = new HTMLPurifier_AttrTypesMock(); $collections = new HTMLPurifier_AttrCollections($types, array()); $collections->info = array( 'Core' => array(0 => array('Inclusion', 'Undefined'), 'attr-original' => 'Type'), @@ -105,7 +105,7 @@ class HTMLPurifier_AttrCollectionsTest extends UnitTestCase generate_mock_once('HTMLPurifier_AttrTypes'); - $types = new HTMLPurifier_AttrTypesMock($this); + $types = new HTMLPurifier_AttrTypesMock(); $collections = new HTMLPurifier_AttrCollections($types, array()); $attr = array( diff --git a/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php b/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php index 037131fb..44acf409 100644 --- a/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php +++ b/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php @@ -29,8 +29,8 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness // first test: value properly validates on first definition // so second def is never called - $def1 = new HTMLPurifier_AttrDefMock($this); - $def2 = new HTMLPurifier_AttrDefMock($this); + $def1 = new HTMLPurifier_AttrDefMock(); + $def2 = new HTMLPurifier_AttrDefMock(); $defs = array(&$def1, &$def2); $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); $input = 'FOOBAR'; @@ -48,8 +48,8 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness // second test, first def fails, second def works - $def1 = new HTMLPurifier_AttrDefMock($this); - $def2 = new HTMLPurifier_AttrDefMock($this); + $def1 = new HTMLPurifier_AttrDefMock(); + $def2 = new HTMLPurifier_AttrDefMock(); $defs = array(&$def1, &$def2); $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); $input = 'BOOMA'; @@ -68,8 +68,8 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness // third test, all fail, so composite faiils - $def1 = new HTMLPurifier_AttrDefMock($this); - $def2 = new HTMLPurifier_AttrDefMock($this); + $def1 = new HTMLPurifier_AttrDefMock(); + $def2 = new HTMLPurifier_AttrDefMock(); $defs = array(&$def1, &$def2); $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); $input = 'BOOMA'; diff --git a/tests/HTMLPurifier/AttrDef/URITest.php b/tests/HTMLPurifier/AttrDef/URITest.php index e6aab057..950244c4 100644 --- a/tests/HTMLPurifier/AttrDef/URITest.php +++ b/tests/HTMLPurifier/AttrDef/URITest.php @@ -202,11 +202,11 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness // $fake_registry isn't the real mock, because due to PHP 4 weirdness // I cannot set a default value to function parameters that are passed // by reference. So we use the value instance() returns. - $fake_registry = new HTMLPurifier_URISchemeRegistryMock($this); + $fake_registry = new HTMLPurifier_URISchemeRegistryMock(); $registry =& HTMLPurifier_URISchemeRegistry::instance($fake_registry); // now, let's add a pseudo-scheme to the registry - $this->scheme = new HTMLPurifier_URISchemeMock($this); + $this->scheme = new HTMLPurifier_URISchemeMock(); // here are the schemes we will support with overloaded mocks $registry->setReturnReference('getScheme', $this->scheme, array('http', '*', '*')); diff --git a/tests/HTMLPurifier/ContextTest.php b/tests/HTMLPurifier/ContextTest.php index c4616573..8d1ccbb5 100644 --- a/tests/HTMLPurifier/ContextTest.php +++ b/tests/HTMLPurifier/ContextTest.php @@ -20,7 +20,7 @@ class HTMLPurifier_ContextTest extends UnitTestCase $this->assertFalse($this->context->exists('IDAccumulator')); - $accumulator = new HTMLPurifier_IDAccumulatorMock($this); + $accumulator = new HTMLPurifier_IDAccumulatorMock(); $this->context->register('IDAccumulator', $accumulator); $this->assertTrue($this->context->exists('IDAccumulator')); diff --git a/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php b/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php index f5411d75..26ec0275 100644 --- a/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php +++ b/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php @@ -9,7 +9,7 @@ class HTMLPurifier_DefinitionCache_DecoratorHarness extends HTMLPurifier_Definit { function setup() { - $this->mock =& new HTMLPurifier_DefinitionCacheMock($this); + $this->mock = new HTMLPurifier_DefinitionCacheMock(); $this->mock->type = 'Test'; $this->cache = $this->cache->decorate($this->mock); $this->def = $this->generateDefinition(); diff --git a/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php b/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php index efe36485..55d15557 100644 --- a/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php +++ b/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php @@ -9,7 +9,7 @@ class HTMLPurifier_DefinitionCache_DecoratorTest extends HTMLPurifier_Definition function test() { generate_mock_once('HTMLPurifier_DefinitionCache'); - $mock =& new HTMLPurifier_DefinitionCacheMock($this); + $mock = new HTMLPurifier_DefinitionCacheMock(); $mock->type = 'Test'; $cache = new HTMLPurifier_DefinitionCache_Decorator(); diff --git a/tests/HTMLPurifier/DefinitionCacheHarness.php b/tests/HTMLPurifier/DefinitionCacheHarness.php index efcb49a4..e422e80e 100644 --- a/tests/HTMLPurifier/DefinitionCacheHarness.php +++ b/tests/HTMLPurifier/DefinitionCacheHarness.php @@ -10,7 +10,7 @@ class HTMLPurifier_DefinitionCacheHarness extends UnitTestCase */ function generateConfigMock($serial = 'defaultserial') { generate_mock_once('HTMLPurifier_Config'); - $config = new HTMLPurifier_ConfigMock($this); + $config = new HTMLPurifier_ConfigMock(); $config->setReturnValue('getBatchSerial', $serial, array('Test')); $config->version = '1.0.0'; return $config; diff --git a/tests/HTMLPurifier/ErrorsHarness.php b/tests/HTMLPurifier/ErrorsHarness.php index 744f09fe..7b9f508a 100644 --- a/tests/HTMLPurifier/ErrorsHarness.php +++ b/tests/HTMLPurifier/ErrorsHarness.php @@ -13,7 +13,7 @@ class HTMLPurifier_ErrorsHarness extends UnitTestCase $this->config = HTMLPurifier_Config::create(array('Core.CollectErrors' => true)); $this->context = new HTMLPurifier_Context(); generate_mock_once('HTMLPurifier_ErrorCollector'); - $this->collector = new HTMLPurifier_ErrorCollectorMock($this); + $this->collector = new HTMLPurifier_ErrorCollectorMock(); $this->context->register('ErrorCollector', $this->collector); } diff --git a/tests/HTMLPurifier/HTMLModule/TidyTest.php b/tests/HTMLPurifier/HTMLModule/TidyTest.php index f3a1f977..13eef45e 100644 --- a/tests/HTMLPurifier/HTMLModule/TidyTest.php +++ b/tests/HTMLPurifier/HTMLModule/TidyTest.php @@ -45,7 +45,7 @@ class HTMLPurifier_HTMLModule_TidyTest extends UnitTestCase $i = 0; // counter, helps us isolate expectations // initialize partial mock - $module = new HTMLPurifier_HTMLModule_Tidy_TestForConstruct($this); + $module = new HTMLPurifier_HTMLModule_Tidy_TestForConstruct(); $module->fixesForLevel['light'] = array('light-fix-1', 'light-fix-2'); $module->fixesForLevel['medium'] = array('medium-fix-1', 'medium-fix-2'); $module->fixesForLevel['heavy'] = array('heavy-fix-1', 'heavy-fix-2'); diff --git a/tests/HTMLPurifier/HTMLModuleManagerTest.php b/tests/HTMLPurifier/HTMLModuleManagerTest.php index b74df5f4..f5ff1d52 100644 --- a/tests/HTMLPurifier/HTMLModuleManagerTest.php +++ b/tests/HTMLPurifier/HTMLModuleManagerTest.php @@ -13,7 +13,7 @@ class HTMLPurifier_HTMLModuleManagerTest extends UnitTestCase $attrdef_nmtokens->_name = 'nmtokens'; // for testing only generate_mock_once('HTMLPurifier_AttrDef'); - $attrdef =& new HTMLPurifier_AttrDefMock($this); + $attrdef = new HTMLPurifier_AttrDefMock(); $attrdef->setReturnValue('make', $attrdef_nmtokens); $manager->attrTypes->info['NMTOKENS'] =& $attrdef; diff --git a/tests/HTMLPurifier/Strategy/CompositeTest.php b/tests/HTMLPurifier/Strategy/CompositeTest.php index 591fc3ef..b742f11e 100644 --- a/tests/HTMLPurifier/Strategy/CompositeTest.php +++ b/tests/HTMLPurifier/Strategy/CompositeTest.php @@ -26,9 +26,9 @@ class HTMLPurifier_Strategy_CompositeTest extends UnitTestCase // setup a bunch of mock strategies to inject into our composite test - $mock_1 = new HTMLPurifier_StrategyMock($this); - $mock_2 = new HTMLPurifier_StrategyMock($this); - $mock_3 = new HTMLPurifier_StrategyMock($this); + $mock_1 = new HTMLPurifier_StrategyMock(); + $mock_2 = new HTMLPurifier_StrategyMock(); + $mock_3 = new HTMLPurifier_StrategyMock(); // setup the object diff --git a/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php b/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php index 78988cb3..0fcefb89 100644 --- a/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php +++ b/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php @@ -30,13 +30,13 @@ class HTMLPurifier_Strategy_RemoveForeignElements_ErrorsTest extends HTMLPurifie function testForeignElementToText() { // uses $CurrentToken.Serialized $this->config->set('Core', 'EscapeInvalidTags', true); - $this->expectErrorCollection(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text', 'cannot-possibly-exist-element'); + $this->expectErrorCollection(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); $this->invoke(''); } function testForeignElementRemoved() { // uses $CurrentToken.Serialized - $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed', 'cannot-possibly-exist-element'); + $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); $this->invoke(''); } diff --git a/tests/HTMLPurifier/URISchemeRegistryTest.php b/tests/HTMLPurifier/URISchemeRegistryTest.php index 8edc3bdc..e9474cea 100644 --- a/tests/HTMLPurifier/URISchemeRegistryTest.php +++ b/tests/HTMLPurifier/URISchemeRegistryTest.php @@ -18,9 +18,9 @@ class HTMLPurifier_URISchemeRegistryTest extends UnitTestCase $registry = new HTMLPurifier_URISchemeRegistry(); $this->assertIsA($registry->getScheme('http', $config, $context), 'HTMLPurifier_URIScheme_http'); - $scheme_http = new HTMLPurifier_URISchemeMock($this); - $scheme_telnet = new HTMLPurifier_URISchemeMock($this); - $scheme_foobar = new HTMLPurifier_URISchemeMock($this); + $scheme_http = new HTMLPurifier_URISchemeMock(); + $scheme_telnet = new HTMLPurifier_URISchemeMock(); + $scheme_foobar = new HTMLPurifier_URISchemeMock(); // register a new scheme $registry->register('telnet', $scheme_telnet);