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();
* @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/' => '',
* 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);
}
$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');
}
$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/',
));
}
// 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/',