Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    /**
99
    /**
100
     * Tests for get_template_directories_for_component when dealing with an invalid component.
100
     * Tests for get_template_directories_for_component when dealing with an invalid component.
101
     */
101
     */
102
    public function test_invalid_component_get_template_directories_for_component() {
102
    public function test_invalid_component_get_template_directories_for_component(): void {
103
        // Test something invalid.
103
        // Test something invalid.
104
        $this->expectException(\coding_exception::class);
104
        $this->expectException(\coding_exception::class);
105
        mustache_template_finder::get_template_directories_for_component('octopus', 'classic');
105
        mustache_template_finder::get_template_directories_for_component('octopus', 'classic');
Línea 175... Línea 175...
175
     * @dataProvider valid_template_filepath_provider
175
     * @dataProvider valid_template_filepath_provider
176
     * @param   string $template
176
     * @param   string $template
177
     * @param   string $theme
177
     * @param   string $theme
178
     * @param   string $location
178
     * @param   string $location
179
     */
179
     */
180
    public function test_get_template_filepath(string $template, string $theme, string $location) {
180
    public function test_get_template_filepath(string $template, string $theme, string $location): void {
181
        global $CFG;
181
        global $CFG;
Línea 182... Línea 182...
182
 
182
 
183
        $filename = mustache_template_finder::get_template_filepath($template, $theme);
183
        $filename = mustache_template_finder::get_template_filepath($template, $theme);
184
        $this->assertEquals("{$CFG->dirroot}/{$location}", $filename);
184
        $this->assertEquals("{$CFG->dirroot}/{$location}", $filename);
Línea 185... Línea 185...
185
    }
185
    }
186
 
186
 
187
    /**
187
    /**
188
     * Tests for get_template_filepath when dealing with an invalid component.
188
     * Tests for get_template_filepath when dealing with an invalid component.
189
     */
189
     */
190
    public function test_invalid_component_get_template_filepath() {
190
    public function test_invalid_component_get_template_filepath(): void {
191
        $this->expectException(\moodle_exception::class);
191
        $this->expectException(\moodle_exception::class);
192
        mustache_template_finder::get_template_filepath('core/octopus', 'classic');
192
        mustache_template_finder::get_template_filepath('core/octopus', 'classic');