Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 30... Línea 30...
30
/**
30
/**
31
 * Unit tests for the `icon_system` class.
31
 * Unit tests for the `icon_system` class.
32
 *
32
 *
33
 * @coversDefaultClass \core\output\choicelist
33
 * @coversDefaultClass \core\output\choicelist
34
 */
34
 */
35
class choicelist_test extends advanced_testcase {
35
final class choicelist_test extends advanced_testcase {
36
    /**
36
    /**
37
     * Test for a choice without options.
37
     * Test for a choice without options.
38
     *
38
     *
39
     * @covers ::_construct
39
     * @covers ::__construct
40
     * @covers ::add_option
40
     * @covers ::add_option
41
     * @covers ::export_for_template
41
     * @covers ::export_for_template
42
     */
42
     */
43
    public function test_empty_export(): void {
43
    public function test_empty_export(): void {
44
        $page = new \moodle_page();
44
        $page = new \moodle_page();
Línea 55... Línea 55...
55
    }
55
    }
Línea 56... Línea 56...
56
 
56
 
57
    /**
57
    /**
58
     * Test for a choice with basic options.
58
     * Test for a choice with basic options.
59
     *
59
     *
60
     * @covers ::_construct
60
     * @covers ::__construct
61
     * @covers ::add_option
61
     * @covers ::add_option
62
     * @covers ::export_for_template
62
     * @covers ::export_for_template
63
     */
63
     */
64
    public function test_basic_export(): void {
64
    public function test_basic_export(): void {
Línea 80... Línea 80...
80
        $this->validate_option($export['options'][1], 'option2', 'Option 2', []);
80
        $this->validate_option($export['options'][1], 'option2', 'Option 2', []);
81
    }
81
    }
82
    /**
82
    /**
83
     * Test for a choice with extras options definition.
83
     * Test for a choice with extras options definition.
84
     *
84
     *
85
     * @covers ::_construct
85
     * @covers ::__construct
86
     * @covers ::add_option
86
     * @covers ::add_option
87
     * @covers ::set_option_extras
87
     * @covers ::set_option_extras
88
     * @covers ::export_for_template
88
     * @covers ::export_for_template
89
     */
89
     */
90
    public function test_option_defintion_export(): void {
90
    public function test_option_defintion_export(): void {
Línea 124... Línea 124...
124
    }
124
    }
Línea 125... Línea 125...
125
 
125
 
126
    /**
126
    /**
127
     * Test for a choice with option selected.
127
     * Test for a choice with option selected.
128
     *
128
     *
129
     * @covers ::_construct
129
     * @covers ::__construct
130
     * @covers ::add_option
130
     * @covers ::add_option
131
     * @covers ::set_selected_value
131
     * @covers ::set_selected_value
132
     * @covers ::get_selected_value
132
     * @covers ::get_selected_value
133
     * @covers ::export_for_template
133
     * @covers ::export_for_template
Línea 194... Línea 194...
194
    }
194
    }
Línea 195... Línea 195...
195
 
195
 
196
    /**
196
    /**
197
     * Test for a choice with option selected.
197
     * Test for a choice with option selected.
198
     *
198
     *
199
     * @covers ::_construct
199
     * @covers ::__construct
200
     * @covers ::add_option
200
     * @covers ::add_option
201
     * @covers ::set_selected_value
201
     * @covers ::set_selected_value
202
     * @covers ::get_selected_value
202
     * @covers ::get_selected_value
203
     * @covers ::set_allow_empty
203
     * @covers ::set_allow_empty