From b0ffdb5e96bb2bdbf27087b2f1335f7949ab8598 Mon Sep 17 00:00:00 2001 From: Adrian Lang <lang@cosmocode.de> Date: Tue, 23 Mar 2010 15:22:21 +0100 Subject: [PATCH] Make tests PHP 5.3 compatible --- _test/cases/inc/html_hilight.test.php | 4 +--- _test/cases/inc/parser/xhtml_htmlphp.test.php | 4 +--- _test/cases/lib/exe/js_js_compress.test.php | 4 ++-- _test/lib/testmanager.php | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/_test/cases/inc/html_hilight.test.php b/_test/cases/inc/html_hilight.test.php index 85f224b6e..cc5579c71 100644 --- a/_test/cases/inc/html_hilight.test.php +++ b/_test/cases/inc/html_hilight.test.php @@ -2,9 +2,7 @@ require_once DOKU_INC.'inc/html.php'; -if ( !extension_loaded('runkit') && - !@dl('runkit.dll') && - !@dl('runkit.so' ) ){ +if (!extension_loaded('runkit')) { SimpleTestOptions::ignore('html_hilight_test'); trigger_error('Skipping html_hilight_test - http://www.php.net/runkit required'); } diff --git a/_test/cases/inc/parser/xhtml_htmlphp.test.php b/_test/cases/inc/parser/xhtml_htmlphp.test.php index 3493bab4d..65d64e579 100644 --- a/_test/cases/inc/parser/xhtml_htmlphp.test.php +++ b/_test/cases/inc/parser/xhtml_htmlphp.test.php @@ -5,9 +5,7 @@ require_once 'parser.inc.php'; require_once DOKU_INC.'inc/parser/xhtml.php'; require_once DOKU_INC.'inc/geshi.php'; -if ( !extension_loaded('runkit') && - !@dl('runkit.dll') && - !@dl('runkit.so' ) ){ +if (!extension_loaded('runkit')) { SimpleTestOptions::ignore('xhtml_htmlphp_test'); trigger_error('Skipping xhtml_htmlphp_test - http://www.php.net/runkit required'); } diff --git a/_test/cases/lib/exe/js_js_compress.test.php b/_test/cases/lib/exe/js_js_compress.test.php index b7de9257d..9051dfb01 100644 --- a/_test/cases/lib/exe/js_js_compress.test.php +++ b/_test/cases/lib/exe/js_js_compress.test.php @@ -71,7 +71,7 @@ class js_js_compress_test extends UnitTestCase { function test_dquotrunaway(){ $text = 'var foo="Now where does it end'; - $this->assertEqual(js_compress($text), "$text"); + $this->assertEqual(js_compress($text), $text); } function test_squot1(){ @@ -81,7 +81,7 @@ class js_js_compress_test extends UnitTestCase { function test_squotrunaway(){ $text = "var foo='Now where does it end"; - $this->assertEqual(js_compress($text), "$text"); + $this->assertEqual(js_compress($text), $text); } function test_nl1(){ diff --git a/_test/lib/testmanager.php b/_test/lib/testmanager.php index def86ca27..14cc20bf3 100644 --- a/_test/lib/testmanager.php +++ b/_test/lib/testmanager.php @@ -7,7 +7,7 @@ define('TEST_GROUPS',realpath(dirname(__FILE__).'/../cases')); define('TEST_CASES',realpath(dirname(__FILE__).'/../cases')); // try to load runkit extension -if (!extension_loaded('runkit')) { +if (!extension_loaded('runkit') && function_exists('dl')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { @dl('php_runkit.dll'); } else { @@ -15,7 +15,6 @@ if (!extension_loaded('runkit')) { } } - class TestManager { var $_testcase_extension = '.test.php'; var $_grouptest_extension = '.group.php'; -- GitLab