public function test_old_icon_url() { global $CFG; $if = new pix_icon_finder(new theme_config()); $this->assertEqual($CFG->httpswwwroot . '/pix/i/course.gif', $if->old_icon_url('i/course')); }
/** * Implement interface method. * @param string $iconname the name of the icon. * @param string $module the module the icon belongs to. * @return string the URL for that icon. */ public function mod_icon_url($iconname, $module) { foreach ($this->places as $dirroot => $urlroot) { if (file_exists($dirroot . 'mod/' . $iconname . '.png')) { return $dirroot . 'mod/' . $iconname . '.png'; } else { if (file_exists($dirroot . 'mod/' . $iconname . '.gif')) { return $dirroot . 'mod/' . $iconname . '.gif'; } } } return parent::old_icon_url($iconname, $module); }