]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16438 fix string manager unit tests.
authortjhunt <tjhunt>
Mon, 22 Jun 2009 06:03:53 +0000 (06:03 +0000)
committertjhunt <tjhunt>
Mon, 22 Jun 2009 06:03:53 +0000 (06:03 +0000)
lib/moodlelib.php
lib/simpletest/teststringmanager.php

index 5f2048016fe954704a19322f3c4483b55c6b7253..336c91a9b2b040cfe40787d885d5e4cbac99eb41 100644 (file)
@@ -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/' => '',
index 3d111c8a083442fe3498cacbfc252a18a00e609d..27130017e89ed5468a8bd4a32552f15c60205099 100644 (file)
@@ -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/',