Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 37... Línea 37...
37
     *
37
     *
38
     * @covers ::create_from_instance
38
     * @covers ::create_from_instance
39
     * @covers ::create_from_coursemodule
39
     * @covers ::create_from_coursemodule
40
     * @covers ::create_from_data_record
40
     * @covers ::create_from_data_record
41
     */
41
     */
42
    public function test_create() {
42
    public function test_create(): void {
Línea 43... Línea 43...
43
 
43
 
44
        $this->resetAfterTest();
44
        $this->resetAfterTest();
Línea 45... Línea 45...
45
        $this->setAdminUser();
45
        $this->setAdminUser();
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Test set_module_viewed
87
     * Test set_module_viewed
88
     * @covers ::set_module_viewed
88
     * @covers ::set_module_viewed
89
     */
89
     */
90
    public function test_set_module_viewed() {
90
    public function test_set_module_viewed(): void {
Línea 91... Línea 91...
91
        global $CFG;
91
        global $CFG;
92
 
92
 
93
        $CFG->enablecompletion = 1;
93
        $CFG->enablecompletion = 1;
Línea 131... Línea 131...
131
 
131
 
132
    /**
132
    /**
133
     * Test set_template_viewed
133
     * Test set_template_viewed
134
     * @covers ::set_template_viewed
134
     * @covers ::set_template_viewed
135
     */
135
     */
136
    public function test_set_template_viewed() {
136
    public function test_set_template_viewed(): void {
137
        $this->resetAfterTest();
137
        $this->resetAfterTest();
Línea 138... Línea 138...
138
        $this->setAdminUser();
138
        $this->setAdminUser();
139
 
139
 
Línea 167... Línea 167...
167
    /**
167
    /**
168
     * Test for has_records().
168
     * Test for has_records().
169
     *
169
     *
170
     * @covers ::has_records
170
     * @covers ::has_records
171
     */
171
     */
172
    public function test_has_records() {
172
    public function test_has_records(): void {
173
        global $DB;
173
        global $DB;
Línea 174... Línea 174...
174
 
174
 
Línea 175... Línea 175...
175
        $this->resetAfterTest();
175
        $this->resetAfterTest();
Línea 194... Línea 194...
194
    /**
194
    /**
195
     * Test for has_fields().
195
     * Test for has_fields().
196
     *
196
     *
197
     * @covers ::has_fields
197
     * @covers ::has_fields
198
     */
198
     */
199
    public function test_has_fields() {
199
    public function test_has_fields(): void {
200
        $this->resetAfterTest();
200
        $this->resetAfterTest();
Línea 201... Línea 201...
201
 
201
 
202
        $course = $this->getDataGenerator()->create_course();
202
        $course = $this->getDataGenerator()->create_course();
203
        $activity = $this->getDataGenerator()->create_module(manager::MODULE, ['course' => $course]);
203
        $activity = $this->getDataGenerator()->create_module(manager::MODULE, ['course' => $course]);
Línea 220... Línea 220...
220
    /**
220
    /**
221
     * Test for get_available_presets().
221
     * Test for get_available_presets().
222
     *
222
     *
223
     * @covers ::get_available_presets
223
     * @covers ::get_available_presets
224
     */
224
     */
225
    public function test_get_available_presets() {
225
    public function test_get_available_presets(): void {
226
        global $DB;
226
        global $DB;
Línea 227... Línea 227...
227
 
227
 
Línea 228... Línea 228...
228
        $this->resetAfterTest();
228
        $this->resetAfterTest();
Línea 321... Línea 321...
321
    /**
321
    /**
322
     * Test for get_available_plugin_presets().
322
     * Test for get_available_plugin_presets().
323
     *
323
     *
324
     * @covers ::get_available_plugin_presets
324
     * @covers ::get_available_plugin_presets
325
     */
325
     */
326
    public function test_get_available_plugin_presets() {
326
    public function test_get_available_plugin_presets(): void {
327
        $this->resetAfterTest();
327
        $this->resetAfterTest();
328
        $this->setAdminUser();
328
        $this->setAdminUser();
Línea 329... Línea 329...
329
 
329
 
330
        $course = $this->getDataGenerator()->create_course();
330
        $course = $this->getDataGenerator()->create_course();
Línea 367... Línea 367...
367
    /**
367
    /**
368
     * Test for get_available_saved_presets().
368
     * Test for get_available_saved_presets().
369
     *
369
     *
370
     * @covers ::get_available_saved_presets
370
     * @covers ::get_available_saved_presets
371
     */
371
     */
372
    public function test_get_available_saved_presets() {
372
    public function test_get_available_saved_presets(): void {
373
        global $DB;
373
        global $DB;
Línea 374... Línea 374...
374
 
374
 
Línea 375... Línea 375...
375
        $this->resetAfterTest();
375
        $this->resetAfterTest();
Línea 437... Línea 437...
437
     * @param bool $ownpreset if the preset belongs to the user
437
     * @param bool $ownpreset if the preset belongs to the user
438
     * @param bool|null $useridparam if the method should be called with a user id param
438
     * @param bool|null $useridparam if the method should be called with a user id param
439
     * @param bool $plugin if the preset is a plugin or not
439
     * @param bool $plugin if the preset is a plugin or not
440
     * @param bool $expected the expected result
440
     * @param bool $expected the expected result
441
     */
441
     */
442
    public function test_can_view_preset(string $rolename, bool $ownpreset, ?bool $useridparam, bool $plugin, bool $expected) {
442
    public function test_can_view_preset(string $rolename, bool $ownpreset, ?bool $useridparam, bool $plugin, bool $expected): void {
Línea 443... Línea 443...
443
 
443
 
Línea 444... Línea 444...
444
        $this->resetAfterTest();
444
        $this->resetAfterTest();
445
 
445
 
Línea 576... Línea 576...
576
    /**
576
    /**
577
     * Test for can_export_entries().
577
     * Test for can_export_entries().
578
     *
578
     *
579
     * @covers ::can_export_entries
579
     * @covers ::can_export_entries
580
     */
580
     */
581
    public function test_can_export_entries() {
581
    public function test_can_export_entries(): void {
582
        global $DB;
582
        global $DB;
Línea 583... Línea 583...
583
 
583
 
Línea 584... Línea 584...
584
        $this->resetAfterTest();
584
        $this->resetAfterTest();
Línea 641... Línea 641...
641
    /*
641
    /*
642
     * Test reset_all_templates.
642
     * Test reset_all_templates.
643
     *
643
     *
644
     * @covers ::reset_all_templates
644
     * @covers ::reset_all_templates
645
     */
645
     */
646
    public function test_reset_all_templates() {
646
    public function test_reset_all_templates(): void {
647
        global $DB;
647
        global $DB;
Línea 648... Línea 648...
648
 
648
 
649
        $this->resetAfterTest();
649
        $this->resetAfterTest();
Línea 687... Línea 687...
687
     * @covers ::reset_template
687
     * @covers ::reset_template
688
     * @dataProvider reset_template_provider
688
     * @dataProvider reset_template_provider
689
     * @param string $templatetoreset the template to reset
689
     * @param string $templatetoreset the template to reset
690
     * @param string[] $expected the expected templates to be reset
690
     * @param string[] $expected the expected templates to be reset
691
     */
691
     */
692
    public function test_reset_template(string $templatetoreset, array $expected) {
692
    public function test_reset_template(string $templatetoreset, array $expected): void {
693
        global $DB;
693
        global $DB;
Línea 694... Línea 694...
694
 
694
 
695
        $this->resetAfterTest();
695
        $this->resetAfterTest();