diff options
author | Guy Brand <gb@unistra.fr> | 2010-09-23 08:41:38 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2010-09-23 08:41:38 +0200 |
commit | 80c36a2739e745db2be34f09c8f321bfdb5e6166 (patch) | |
tree | cc15cdb12583b6536398f3e0993527971ef26b62 /_test | |
parent | 42de51b18d302d07e109c24dfb0ae237e6d38643 (diff) | |
download | rpg-80c36a2739e745db2be34f09c8f321bfdb5e6166.tar.gz rpg-80c36a2739e745db2be34f09c8f321bfdb5e6166.tar.bz2 |
fixed new calls in test cases according to PHP5 conventions
Diffstat (limited to '_test')
-rw-r--r-- | _test/cases/inc/parser/lexer.test.php | 98 | ||||
-rw-r--r-- | _test/cases/inc/parser/parser.inc.php | 4 | ||||
-rw-r--r-- | _test/lib/testmanager.php | 66 |
3 files changed, 84 insertions, 84 deletions
diff --git a/_test/cases/inc/parser/lexer.test.php b/_test/cases/inc/parser/lexer.test.php index cbfce9ba9..e802277f1 100644 --- a/_test/cases/inc/parser/lexer.test.php +++ b/_test/cases/inc/parser/lexer.test.php @@ -19,24 +19,24 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->UnitTestCase(); } function testNoPatterns() { - $regex = &new Doku_LexerParallelRegex(false); + $regex = new Doku_LexerParallelRegex(false); $this->assertFalse($regex->match("Hello", $match)); $this->assertEqual($match, ""); } function testNoSubject() { - $regex = &new Doku_LexerParallelRegex(false); + $regex = new Doku_LexerParallelRegex(false); $regex->addPattern(".*"); $this->assertTrue($regex->match("", $match)); $this->assertEqual($match, ""); } function testMatchAll() { - $regex = &new Doku_LexerParallelRegex(false); + $regex = new Doku_LexerParallelRegex(false); $regex->addPattern(".*"); $this->assertTrue($regex->match("Hello", $match)); $this->assertEqual($match, "Hello"); } function testCaseSensitive() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("abc"); $this->assertTrue($regex->match("abcdef", $match)); $this->assertEqual($match, "abc"); @@ -44,7 +44,7 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->assertEqual($match, "abc"); } function testCaseInsensitive() { - $regex = &new Doku_LexerParallelRegex(false); + $regex = new Doku_LexerParallelRegex(false); $regex->addPattern("abc"); $this->assertTrue($regex->match("abcdef", $match)); $this->assertEqual($match, "abc"); @@ -52,7 +52,7 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->assertEqual($match, "ABC"); } function testMatchMultiple() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("abc"); $regex->addPattern("ABC"); $this->assertTrue($regex->match("abcdef", $match)); @@ -62,7 +62,7 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->assertFalse($regex->match("Hello", $match)); } function testPatternLabels() { - $regex = &new Doku_LexerParallelRegex(false); + $regex = new Doku_LexerParallelRegex(false); $regex->addPattern("abc", "letter"); $regex->addPattern("123", "number"); $this->assertIdentical($regex->match("abcdef", $match), "letter"); @@ -71,7 +71,7 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->assertEqual($match, "123"); } function testMatchMultipleWithLookaheadNot() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("abc"); $regex->addPattern("ABC"); $regex->addPattern("a(?!\n).{1}"); @@ -84,37 +84,37 @@ class TestOfLexerParallelRegex extends UnitTestCase { $this->assertFalse($regex->match("Hello", $match)); } function testMatchSetOptionCaseless() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("a(?i)b(?i)c"); $this->assertTrue($regex->match("aBc", $match)); $this->assertEqual($match, "aBc"); } function testMatchSetOptionUngreedy() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("(?U)\w+"); $this->assertTrue($regex->match("aaaaaa", $match)); $this->assertEqual($match, "a"); } function testMatchLookaheadEqual() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("\w(?=c)"); $this->assertTrue($regex->match("xbyczd", $match)); $this->assertEqual($match, "y"); } function testMatchLookaheadNot() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("\w(?!b|c)"); $this->assertTrue($regex->match("xbyczd", $match)); $this->assertEqual($match, "b"); } function testMatchLookbehindEqual() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("(?<=c)\w"); $this->assertTrue($regex->match("xbyczd", $match)); $this->assertEqual($match, "z"); } function testMatchLookbehindNot() { - $regex = &new Doku_LexerParallelRegex(true); + $regex = new Doku_LexerParallelRegex(true); $regex->addPattern("(?<!\A|x|b)\w"); $this->assertTrue($regex->match("xbyczd", $match)); $this->assertEqual($match, "c"); @@ -127,15 +127,15 @@ class TestOfLexerStateStack extends UnitTestCase { $this->UnitTestCase(); } function testStartState() { - $stack = &new Doku_LexerStateStack("one"); + $stack = new Doku_LexerStateStack("one"); $this->assertEqual($stack->getCurrent(), "one"); } function testExhaustion() { - $stack = &new Doku_LexerStateStack("one"); + $stack = new Doku_LexerStateStack("one"); $this->assertFalse($stack->leave()); } function testStateMoves() { - $stack = &new Doku_LexerStateStack("one"); + $stack = new Doku_LexerStateStack("one"); $stack->enter("two"); $this->assertEqual($stack->getCurrent(), "two"); $stack->enter("three"); @@ -167,24 +167,24 @@ class TestOfLexer extends UnitTestCase { $this->UnitTestCase(); } function testNoPatterns() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->expectNever("accept"); $handler->setReturnValue("accept", true); - $lexer = &new Doku_Lexer($handler); + $lexer = new Doku_Lexer($handler); $this->assertFalse($lexer->parse("abcdef")); } function testEmptyPage() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->expectNever("accept"); $handler->setReturnValue("accept", true); $handler->expectNever("accept"); $handler->setReturnValue("accept", true); - $lexer = &new Doku_Lexer($handler); + $lexer = new Doku_Lexer($handler); $lexer->addPattern("a+"); $this->assertTrue($lexer->parse("")); } function testSinglePattern() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->expectArgumentsAt(0, "accept", array("aaa", DOKU_LEXER_MATCHED, 0)); $handler->expectArgumentsAt(1, "accept", array("x", DOKU_LEXER_UNMATCHED, 3)); $handler->expectArgumentsAt(2, "accept", array("a", DOKU_LEXER_MATCHED, 4)); @@ -195,13 +195,13 @@ class TestOfLexer extends UnitTestCase { $handler->expectArgumentsAt(7, "accept", array("z", DOKU_LEXER_UNMATCHED, 13)); $handler->expectCallCount("accept", 8); $handler->setReturnValue("accept", true); - $lexer = &new Doku_Lexer($handler); + $lexer = new Doku_Lexer($handler); $lexer->addPattern("a+"); $this->assertTrue($lexer->parse("aaaxayyyaxaaaz")); $handler->tally(); } function testMultiplePattern() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $target = array("a", "b", "a", "bb", "x", "b", "a", "xxxxxx", "a", "x"); $positions = array(0,1,2,3,5,6,7,8,14,15); for ($i = 0; $i < count($target); $i++) { @@ -209,7 +209,7 @@ class TestOfLexer extends UnitTestCase { } $handler->expectCallCount("accept", count($target)); $handler->setReturnValue("accept", true); - $lexer = &new Doku_Lexer($handler); + $lexer = new Doku_Lexer($handler); $lexer->addPattern("a+"); $lexer->addPattern("b+"); $this->assertTrue($lexer->parse("ababbxbaxxxxxxax")); @@ -222,7 +222,7 @@ class TestOfLexerModes extends UnitTestCase { $this->UnitTestCase(); } function testIsolatedPattern() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->expectArgumentsAt(0, "a", array("a", DOKU_LEXER_MATCHED,0)); $handler->expectArgumentsAt(1, "a", array("b", DOKU_LEXER_UNMATCHED,1)); $handler->expectArgumentsAt(2, "a", array("aa", DOKU_LEXER_MATCHED,2)); @@ -233,14 +233,14 @@ class TestOfLexerModes extends UnitTestCase { $handler->expectArgumentsAt(7, "a", array("x", DOKU_LEXER_UNMATCHED,15)); $handler->expectCallCount("a", 8); $handler->setReturnValue("a", true); - $lexer = &new Doku_Lexer($handler, "a"); + $lexer = new Doku_Lexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addPattern("b+", "b"); $this->assertTrue($lexer->parse("abaabxbaaaxaaaax")); $handler->tally(); } function testModeChange() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->expectArgumentsAt(0, "a", array("a", DOKU_LEXER_MATCHED,0)); $handler->expectArgumentsAt(1, "a", array("b", DOKU_LEXER_UNMATCHED,1)); $handler->expectArgumentsAt(2, "a", array("aa", DOKU_LEXER_MATCHED,2)); @@ -258,7 +258,7 @@ class TestOfLexerModes extends UnitTestCase { $handler->expectCallCount("b", 8); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); - $lexer = &new Doku_Lexer($handler, "a"); + $lexer = new Doku_Lexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addEntryPattern(":", "a", "b"); $lexer->addPattern("b+", "b"); @@ -266,7 +266,7 @@ class TestOfLexerModes extends UnitTestCase { $handler->tally(); } function testNesting() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); $handler->expectArgumentsAt(0, "a", array("aa", DOKU_LEXER_MATCHED,0)); @@ -282,7 +282,7 @@ class TestOfLexerModes extends UnitTestCase { $handler->expectArgumentsAt(5, "a", array("b", DOKU_LEXER_UNMATCHED,15)); $handler->expectCallCount("a", 6); $handler->expectCallCount("b", 5); - $lexer = &new Doku_Lexer($handler, "a"); + $lexer = new Doku_Lexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addEntryPattern("(", "a", "b"); $lexer->addPattern("b+", "b"); @@ -291,7 +291,7 @@ class TestOfLexerModes extends UnitTestCase { $handler->tally(); } function testSingular() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->setReturnValue("a", true); $handler->setReturnValue("b", true); $handler->expectArgumentsAt(0, "a", array("aa", DOKU_LEXER_MATCHED,0)); @@ -302,19 +302,19 @@ class TestOfLexerModes extends UnitTestCase { $handler->expectArgumentsAt(1, "b", array("bbb", DOKU_LEXER_SPECIAL,7)); $handler->expectCallCount("a", 4); $handler->expectCallCount("b", 2); - $lexer = &new Doku_Lexer($handler, "a"); + $lexer = new Doku_Lexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addSpecialPattern("b+", "a", "b"); $this->assertTrue($lexer->parse("aabaaxxbbbxx")); $handler->tally(); } function testUnwindTooFar() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->setReturnValue("a", true); $handler->expectArgumentsAt(0, "a", array("aa", DOKU_LEXER_MATCHED,0)); $handler->expectArgumentsAt(1, "a", array(")", DOKU_LEXER_EXIT,2)); $handler->expectCallCount("a", 2); - $lexer = &new Doku_Lexer($handler, "a"); + $lexer = new Doku_Lexer($handler, "a"); $lexer->addPattern("a+", "a"); $lexer->addExitPattern(")", "a"); $this->assertFalse($lexer->parse("aa)aa")); @@ -327,7 +327,7 @@ class TestOfLexerHandlers extends UnitTestCase { $this->UnitTestCase(); } function testModeMapping() { - $handler = &new MockTestParser($this); + $handler = new MockTestParser($this); $handler->setReturnValue("a", true); $handler->expectArgumentsAt(0, "a", array("aa", DOKU_LEXER_MATCHED,0)); $handler->expectArgumentsAt(1, "a", array("(", DOKU_LEXER_ENTER,2)); @@ -337,7 +337,7 @@ class TestOfLexerHandlers extends UnitTestCase { $handler->expectArgumentsAt(5, "a", array(")", DOKU_LEXER_EXIT,8)); $handler->expectArgumentsAt(6, "a", array("b", DOKU_LEXER_UNMATCHED,9)); $handler->expectCallCount("a", 7); - $lexer = &new Doku_Lexer($handler, "mode_a"); + $lexer = new Doku_Lexer($handler, "mode_a"); $lexer->addPattern("a+", "mode_a"); $lexer->addEntryPattern("(", "mode_a", "mode_b"); $lexer->addPattern("b+", "mode_b"); @@ -369,7 +369,7 @@ class TestOfLexerByteIndices extends UnitTestCase { function testIndex() { $doc = "aaa<file>bcd</file>eee"; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -400,7 +400,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 5); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addEntryPattern("<file>", "ignore", "caught"); $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); @@ -414,7 +414,7 @@ class TestOfLexerByteIndices extends UnitTestCase { function testIndexLookaheadEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -445,7 +445,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 5); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addEntryPattern('<file>(?=.*</file>)', "ignore", "caught"); $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); @@ -459,7 +459,7 @@ class TestOfLexerByteIndices extends UnitTestCase { function testIndexLookaheadNotEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -490,7 +490,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 5); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addEntryPattern('<file>(?!foo)', "ignore", "caught"); $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); @@ -504,7 +504,7 @@ class TestOfLexerByteIndices extends UnitTestCase { function testIndexLookbehindEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -535,7 +535,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 5); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addEntryPattern('<file>', "ignore", "caught"); $lexer->addExitPattern("(?<=d)</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); @@ -549,7 +549,7 @@ class TestOfLexerByteIndices extends UnitTestCase { function testIndexLookbehindNotEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -580,7 +580,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 5); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addEntryPattern('<file>', "ignore", "caught"); $lexer->addExitPattern("(?<!c)</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); @@ -599,7 +599,7 @@ class TestOfLexerByteIndices extends UnitTestCase { $doc = "ALL FOOLS ARE FOO"; $pattern = '\bFOO\b'; - $handler = &new MockTestParserByteIndex($this); + $handler = new MockTestParserByteIndex($this); $handler->setReturnValue("ignore", true); $handler->setReturnValue("caught", true); @@ -613,7 +613,7 @@ class TestOfLexerByteIndices extends UnitTestCase { ); $handler->expectCallCount("caught", 1); - $lexer = &new Doku_Lexer($handler, "ignore"); + $lexer = new Doku_Lexer($handler, "ignore"); $lexer->addSpecialPattern($pattern,'ignore','caught'); $this->assertTrue($lexer->parse($doc)); diff --git a/_test/cases/inc/parser/parser.inc.php b/_test/cases/inc/parser/parser.inc.php index 22574d579..74d956f43 100644 --- a/_test/cases/inc/parser/parser.inc.php +++ b/_test/cases/inc/parser/parser.inc.php @@ -33,8 +33,8 @@ class TestOfDoku_Parser extends UnitTestCase { } function setup() { - $this->P = & new Doku_Parser(); - $this->H = & new Doku_Handler(); + $this->P = new Doku_Parser(); + $this->H = new Doku_Handler(); $this->P->Handler = & $this->H; } diff --git a/_test/lib/testmanager.php b/_test/lib/testmanager.php index 96c9a57a2..06efd2694 100644 --- a/_test/lib/testmanager.php +++ b/_test/lib/testmanager.php @@ -51,9 +51,9 @@ class TestManager { } function runAllTests(&$reporter) { - $manager =& new TestManager(); + $manager = new TestManager(); $test_cases =& $manager->_getTestFileList(); - $test =& new GroupTest('All Tests'); + $test = new GroupTest('All Tests'); foreach ($test_cases as $test_case) { $test->addTestFile($test_case); } @@ -61,9 +61,9 @@ class TestManager { } function runAllPluginTests(&$reporter) { - $manager =& new TestManager(); + $manager = new TestManager(); $test_cases =& $manager->_getTestFileList(TEST_PLUGINS); - $test =& new GroupTest('All Plugin Tests'); + $test = new GroupTest('All Plugin Tests'); foreach ($test_cases as $test_case) { $test->addTestFile($test_case); } @@ -72,7 +72,7 @@ class TestManager { function runTestCase($testcase_name, $test_case_directory, &$reporter) { - $manager =& new TestManager(); + $manager = new TestManager(); $testcase_name = preg_replace('/[^a-zA-Z0-9_:]/','',$testcase_name); $testcase_name = str_replace(':',DIRECTORY_SEPARATOR,$testcase_name); @@ -85,26 +85,26 @@ class TestManager { E_USER_ERROR); } - $test =& new GroupTest("Individual test case: " . $testcase_name); + $test = new GroupTest("Individual test case: " . $testcase_name); $test->addTestFile($testcase_file); $test->run($reporter); } function runTestFile($testcase_file, &$reporter) { - $manager =& new TestManager(); + $manager = new TestManager(); if (! file_exists($testcase_file)) { trigger_error("Test case {$testcase_file} cannot be found", E_USER_ERROR); } - $test =& new GroupTest("Individual test case: " . $testcase_file); + $test = new GroupTest("Individual test case: " . $testcase_file); $test->addTestFile($testcase_file); $test->run($reporter); } function runGroupTest($group_test_name, $group_test_directory, &$reporter) { - $manager =& new TestManager(); + $manager = new TestManager(); $group_test_name = preg_replace('/[^a-zA-Z0-9_:]/','',$group_test_name); $group_test_name = str_replace(':',DIRECTORY_SEPARATOR,$group_test_name); $file_path = $group_test_directory . DIRECTORY_SEPARATOR . @@ -116,7 +116,7 @@ class TestManager { } require_once $file_path; - $test =& new GroupTest($group_test_name . ' group test'); + $test = new GroupTest($group_test_name . ' group test'); foreach ($manager->_getGroupTestClassNames($file_path) as $group_test) { $test->addTestCase(new $group_test()); } @@ -124,7 +124,7 @@ class TestManager { } function addTestCasesFromDirectory(&$group_test, $directory = '.') { - $manager =& new TestManager(); + $manager = new TestManager(); $test_cases =& $manager->_getTestFileList($directory); foreach ($test_cases as $test_case) { $group_test->addTestFile($test_case); @@ -132,7 +132,7 @@ class TestManager { } function &getTestCaseList($directory = '.') { - $manager =& new TestManager(); + $manager = new TestManager(); return $manager->_getTestCaseList($directory); } @@ -155,17 +155,17 @@ class TestManager { } function &getPluginTestCaseList($directory = '.') { - $manager =& new TestManager(); + $manager = new TestManager(); return $manager->_getTestCaseList($directory); } function &getPluginGroupTestList($directory = '.') { - $manager =& new TestManager(); + $manager = new TestManager(); return $manager->_getTestGroupList($directory); } function &getGroupTestList($directory = '.') { - $manager =& new TestManager(); + $manager = new TestManager(); return $manager->_getTestGroupList($directory); } @@ -244,7 +244,7 @@ class TestManager { */ class CLITestManager extends TestManager { function &getGroupTestList($directory = '.') { - $manager =& new CLITestManager(); + $manager = new CLITestManager(); $group_tests =& $manager->_getTestGroupList($directory); $buffer = "Available grouptests:\n"; @@ -255,7 +255,7 @@ class CLITestManager extends TestManager { } function &getTestCaseList($directory = '.') { - $manager =& new CLITestManager(); + $manager = new CLITestManager(); $test_cases =& $manager->_getTestCaseList($directory); $buffer = "Available test cases:\n"; @@ -266,7 +266,7 @@ class CLITestManager extends TestManager { } function &getPluginTestCaseList($directory = '.') { - $manager =& new CLITestManager(); + $manager = new CLITestManager(); $test_cases =& $manager->_getTestCaseList($directory); $buffer = "Available test cases:\n"; @@ -277,7 +277,7 @@ class CLITestManager extends TestManager { } function &getPluginGroupTestList($directory = '.') { - $manager =& new CLITestManager(); + $manager = new CLITestManager(); $test_cases =& $manager->_getTestGroupList($directory); $buffer = "Available test cases:\n"; @@ -301,7 +301,7 @@ class HTMLTestManager extends TestManager { } function &getGroupTestList($directory = '.') { - $manager =& new HTMLTestManager(); + $manager = new HTMLTestManager(); $group_tests =& $manager->_getTestGroupList($directory); if (1 > count($group_tests)) { return "<p>No test groups set up!</p>"; @@ -318,7 +318,7 @@ class HTMLTestManager extends TestManager { } function &getTestCaseList($directory = '.') { - $manager =& new HTMLTestManager(); + $manager = new HTMLTestManager(); $testcases =& $manager->_getTestCaseList($directory); if (1 > count($testcases)) { @@ -336,7 +336,7 @@ class HTMLTestManager extends TestManager { } function &getPluginTestCaseList($directory = '.') { - $manager =& new HTMLTestManager(); + $manager = new HTMLTestManager(); $testcases =& $manager->_getTestCaseList($directory); if (1 > count($testcases)) { @@ -354,7 +354,7 @@ class HTMLTestManager extends TestManager { } function &getPluginGroupTestList($directory = '.') { - $manager =& new HTMLTestManager(); + $manager = new HTMLTestManager(); $group_tests =& $manager->_getTestGroupList($directory); if (1 > count($group_tests)) { return "<p>No plugin test groups set up!</p>"; @@ -383,7 +383,7 @@ class XMLTestManager extends HTMLTestManager { function &getGroupTestList($directory = '.') { - $manager =& new XMLTestManager(); + $manager = new XMLTestManager(); $group_tests =& $manager->_getTestGroupList($directory); $rss = & $manager->_getRssWriter(); @@ -418,7 +418,7 @@ class XMLTestManager extends HTMLTestManager { function &getTestCaseList($directory = '.') { - $manager =& new XMLTestManager(); + $manager = new XMLTestManager(); $testcases =& $manager->_getTestCaseList($directory); $rss = & $manager->_getRssWriter(); @@ -452,7 +452,7 @@ class XMLTestManager extends HTMLTestManager { require_once TEST_ROOT . '/lib/xml_writer_class.php'; require_once TEST_ROOT . '/lib/rss_writer_class.php'; - $rss_writer_object=& new rss_writer_class(); + $rss_writer_object= new rss_writer_class(); $rss_writer_object->specification="1.0"; $rss_writer_object->about=$url."index.php?output=xml"; $rss_writer_object->stylesheet=$url."rss2html.xsl"; @@ -496,13 +496,13 @@ class RemoteTestManager extends TestManager { function runAllTests(&$reporter, $url = FALSE) { $groups = RemoteTestManager::getGroupTestList($url); - $T = &new RemoteTestCase($groups['All Tests']); + $T = new RemoteTestCase($groups['All Tests']); $T->run($reporter); } function runTestUrl($case_url,& $reporter, $url = FALSE) { RemoteTestManager::_installSimpleTest(); - $T = &new RemoteTestCase($case_url); + $T = new RemoteTestCase($case_url); $T->run($reporter); } @@ -511,7 +511,7 @@ class RemoteTestManager extends TestManager { if ( !array_key_exists($case_id, $cases) ) { trigger_error("Unknown test id $case_id\n",E_USER_ERROR); } - $T = &new RemoteTestCase($cases[$case_id]); + $T = new RemoteTestCase($cases[$case_id]); $T->run($reporter); } @@ -520,7 +520,7 @@ class RemoteTestManager extends TestManager { if ( !array_key_exists($group_name, $groups) ) { trigger_error("Unknown group $group_name\n",E_USER_ERROR); } - $T = &new RemoteTestCase($groups[$group_name]); + $T = new RemoteTestCase($groups[$group_name]); $T->run($reporter); } @@ -532,7 +532,7 @@ class RemoteTestManager extends TestManager { $url .= '?output=xml'; - $manager =& new RemoteTestManager(); + $manager = new RemoteTestManager(); $rss = & $manager->_getRssReader($url); $groupList = array(); @@ -550,7 +550,7 @@ class RemoteTestManager extends TestManager { } $url .= '?show=cases&output=xml'; - $manager =& new RemoteTestManager(); + $manager = new RemoteTestManager(); $rss = & $manager->_getRssReader($url); $caseList = array(); @@ -565,7 +565,7 @@ class RemoteTestManager extends TestManager { function &_getRssReader($url) { require_once "XML/RSS.php"; - $rss_reader =& new XML_RSS($url); + $rss_reader = new XML_RSS($url); $status = $rss_reader->parse(); |