mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-03 20:58:11 +02:00
Merge in PHP5 strict changes that are applicable to PHP4.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@650 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -28,10 +28,10 @@ class HTMLPurifier_AttrDef_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($this);
|
||||
$def2 = new HTMLPurifier_AttrDefMock($this);
|
||||
$defs = array(&$def1, &$def2);
|
||||
$def =& new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$def = new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$input = 'FOOBAR';
|
||||
$output = 'foobar';
|
||||
$def1_params = array($input, $config, $context);
|
||||
@@ -47,10 +47,10 @@ class HTMLPurifier_AttrDef_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($this);
|
||||
$def2 = new HTMLPurifier_AttrDefMock($this);
|
||||
$defs = array(&$def1, &$def2);
|
||||
$def =& new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$def = new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$input = 'BOOMA';
|
||||
$output = 'booma';
|
||||
$def_params = array($input, $config, $context);
|
||||
@@ -67,10 +67,10 @@ class HTMLPurifier_AttrDef_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($this);
|
||||
$def2 = new HTMLPurifier_AttrDefMock($this);
|
||||
$defs = array(&$def1, &$def2);
|
||||
$def =& new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$def = new HTMLPurifier_AttrDef_Composite_Testable($defs);
|
||||
$input = 'BOOMA';
|
||||
$output = false;
|
||||
$def_params = array($input, $config, $context);
|
||||
|
@@ -206,7 +206,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
||||
$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($this);
|
||||
|
||||
// here are the schemes we will support with overloaded mocks
|
||||
$registry->setReturnReference('getScheme', $this->scheme, array('http', $this->config, $this->context));
|
||||
|
@@ -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);
|
||||
$this->context->register('IDAccumulator', $accumulator);
|
||||
$this->assertTrue($this->context->exists('IDAccumulator'));
|
||||
|
||||
|
@@ -16,7 +16,10 @@ class HTMLPurifier_LexerTest extends UnitTestCase
|
||||
|
||||
$this->DirectLex = new HTMLPurifier_Lexer_DirectLex();
|
||||
|
||||
if ( $GLOBALS['HTMLPurifierTest']['PEAR'] ) {
|
||||
// E_STRICT = 2048, int used for PHP4 compat
|
||||
if ( $GLOBALS['HTMLPurifierTest']['PEAR'] &&
|
||||
((error_reporting() & 2048) != 2048)
|
||||
) {
|
||||
$this->_has_pear = true;
|
||||
require_once 'HTMLPurifier/Lexer/PEARSax3.php';
|
||||
$this->PEARSax3 = new HTMLPurifier_Lexer_PEARSax3();
|
||||
|
Reference in New Issue
Block a user