MDL-19698 deprecated assign new by ref in simpletest lib

This commit is contained in:
Petr Skoda
2010-07-19 08:53:16 +00:00
parent 0ad09db03b
commit 0a8f8a65cd
21 changed files with 68 additions and 69 deletions
+7 -7
View File
@@ -107,9 +107,9 @@ class SimpleTestCase {
* @access public
*/
function &createInvoker() {
$invoker = &new SimpleErrorTrappingInvoker(new SimpleInvoker($this));
$invoker = new SimpleErrorTrappingInvoker(new SimpleInvoker($this));
if (version_compare(phpversion(), '5') >= 0) {
$invoker = &new SimpleExceptionTrappingInvoker($invoker);
$invoker = new SimpleExceptionTrappingInvoker($invoker);
}
return $invoker;
}
@@ -467,11 +467,11 @@ class SimpleFileLoader {
*/
function &createSuiteFromClasses($title, $classes) {
if (count($classes) == 0) {
$suite = &new BadTestSuite($title, "No runnable test cases in [$title]");
$suite = new BadTestSuite($title, "No runnable test cases in [$title]");
return $suite;
}
SimpleTest::ignoreParentsIfIgnored($classes);
$suite = &new TestSuite($title);
$suite = new TestSuite($title);
foreach ($classes as $class) {
if (! SimpleTest::isIgnored($class)) {
$suite->addTestClass($class);
@@ -530,7 +530,7 @@ class TestSuite {
*/
function addTestClass($class) {
if (TestSuite::getBaseTestCase($class) == 'testsuite') {
$this->_test_cases[] = &new $class();
$this->_test_cases[] = new $class();
} else {
$this->_test_cases[] = $class;
}
@@ -548,7 +548,7 @@ class TestSuite {
if (! is_string($test_case)) {
$this->_test_cases[] = &$test_case;
} elseif (TestSuite::getBaseTestCase($class) == 'testsuite') {
$this->_test_cases[] = &new $class();
$this->_test_cases[] = new $class();
} else {
$this->_test_cases[] = $class;
}
@@ -611,7 +611,7 @@ class TestSuite {
@ini_set('max_execution_time', $currenttl);
}
// moodle hack end
$test = &new $class();
$test = new $class();
$test->run($reporter);
unset($test);
} else {