MDL-19698 deprecated assign new by ref in simpletest lib
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user