From f0d74a3bf493404f4baf2ffee735b7f7b3252ae1 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sat, 22 Jul 2006 14:00:52 +0000 Subject: [PATCH] Fix parse error in PHP4. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@81 48356398-32a2-884e-a903-53898d9a118a --- tests/Lexer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Lexer.php b/tests/Lexer.php index 8c632745..20891c78 100644 --- a/tests/Lexer.php +++ b/tests/Lexer.php @@ -2,7 +2,6 @@ require_once 'HTMLPurifier/Lexer/DirectLex.php'; require_once 'HTMLPurifier/Lexer/PEARSax3.php'; -require_once 'HTMLPurifier/Lexer/DOMLex.php'; class Test_HTMLPurifier_Lexer extends UnitTestCase { @@ -13,9 +12,14 @@ class Test_HTMLPurifier_Lexer extends UnitTestCase function setUp() { $this->DirectLex = new HTMLPurifier_Lexer_DirectLex(); $this->PEARSax3 = new HTMLPurifier_Lexer_PEARSax3(); - $this->DOMLex = new HTMLPurifier_Lexer_DOMLex(); $this->_has_dom = version_compare(PHP_VERSION, '5', '>='); + + if ($this->_has_dom) { + require_once 'HTMLPurifier/Lexer/DOMLex.php'; + $this->DOMLex = new HTMLPurifier_Lexer_DOMLex(); + } + } function test_nextWhiteSpace() {