From 64208b5de5ac69e8ba1ef4d55941c4b455c8c9ed Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 22 Jun 2009 06:03:53 +0000 Subject: [PATCH] MDL-16438 fix string manager unit tests. --- lib/moodlelib.php | 4 ++-- lib/simpletest/teststringmanager.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 5f2048016f..336c91a9b2 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5667,7 +5667,7 @@ class string_manager { public static function instance() { if (is_null(self::$singletoninstance)) { global $CFG; - self::$singletoninstance = new self($CFG->dirroot, $CFG->dataroot, $CFG->admin, isset($CFG->running_installer)); + self::$singletoninstance = new self($CFG->dirroot, $CFG->dataroot, isset($CFG->running_installer)); // Uncomment the followign line to log every call to get_string // to a file in $CFG->dataroot/temp/getstringlog/... // self::$singletoninstance->start_logging(); @@ -5684,7 +5684,7 @@ class string_manager { * @param string $admin path to the admin directory * @param bool $runninginstaller */ - protected function __construct($dirroot, $dataroot, $admin, $runninginstaller) { + protected function __construct($dirroot, $dataroot, $runninginstaller) { $this->dirroot = $dirroot; $this->corelocations = array( $dirroot . '/lang/' => '', diff --git a/lib/simpletest/teststringmanager.php b/lib/simpletest/teststringmanager.php index 3d111c8a08..27130017e8 100644 --- a/lib/simpletest/teststringmanager.php +++ b/lib/simpletest/teststringmanager.php @@ -40,8 +40,8 @@ require_once($CFG->libdir . '/moodlelib.php'); * Test subclass that makes all the protected methods we want to test pubic. */ class testable_string_manager extends string_manager { - public function __construct($dirroot, $dataroot, $admin, $runninginstaller) { - parent::__construct($dirroot, $dataroot, $admin, $runninginstaller); + public function __construct($dirroot, $dataroot, $runninginstaller) { + parent::__construct($dirroot, $dataroot, $runninginstaller); } public function locations_to_search($module) { return parent::locations_to_search($module); @@ -76,7 +76,7 @@ class string_manager_test extends UnitTestCase { } $this->basedir = $CFG->dataroot . '/' . $this->workspace . '/'; $this->stringmanager = new testable_string_manager($this->basedir . 'moodle', - $this->basedir . 'moodledata', 'adminpath', false); + $this->basedir . 'moodledata', false); make_upload_directory($this->workspace . '/' . 'moodle'); make_upload_directory($this->workspace . '/' . 'moodledata'); } @@ -149,16 +149,16 @@ class string_manager_test extends UnitTestCase { $this->assertEqual($this->stringmanager->locations_to_search('local'), array( $this->basedir . 'moodle/lang/' => 'local/', $this->basedir . 'moodledata/lang/' => 'local/', - $this->basedir . 'moodle/local/lang/' => 'local/', + $this->basedir . 'moodle/mod/local/lang/' => 'local/', )); } public function test_locations_to_search_report() { + global $CFG; $this->assertEqual($this->stringmanager->locations_to_search('report_super'), array( $this->basedir . 'moodle/lang/' => 'report_super/', $this->basedir . 'moodledata/lang/' => 'report_super/', - $this->basedir . 'moodle/adminpath/report/super/lang/' => 'super/', - $this->basedir . 'moodle/course/report/super/lang/' => 'super/', + $this->basedir . 'moodle/' . $CFG->admin . '/report/super/lang/' => 'super/', )); } @@ -178,7 +178,7 @@ class string_manager_test extends UnitTestCase { // custom plugin type from session without us having to re-register it. // This is required to make help files work. $newstringmanager = new testable_string_manager($this->basedir . 'moodle', - $this->basedir . 'moodledata', 'adminpath', false); + $this->basedir . 'moodledata', false); $this->assertEqual($newstringmanager->locations_to_search('mymodreport_test'), array( $this->basedir . 'moodle/lang/' => 'mymodreport_test/', $this->basedir . 'moodledata/lang/' => 'mymodreport_test/', -- 2.39.5