Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 61... Línea 61...
61
 
61
 
62
    /**
62
    /**
63
     * Test folder_view
63
     * Test folder_view
64
     * @return void
64
     * @return void
65
     */
65
     */
66
    public function test_folder_view() {
66
    public function test_folder_view(): void {
Línea 67... Línea 67...
67
        global $CFG;
67
        global $CFG;
Línea 68... Línea 68...
68
 
68
 
Línea 97... Línea 97...
97
        $completion = new \completion_info($course);
97
        $completion = new \completion_info($course);
98
        $completiondata = $completion->get_data($cm);
98
        $completiondata = $completion->get_data($cm);
99
        $this->assertEquals(1, $completiondata->completionstate);
99
        $this->assertEquals(1, $completiondata->completionstate);
100
    }
100
    }
Línea 101... Línea 101...
101
 
101
 
102
    public function test_folder_core_calendar_provide_event_action() {
102
    public function test_folder_core_calendar_provide_event_action(): void {
103
        // Create the activity.
103
        // Create the activity.
104
        $course = $this->getDataGenerator()->create_course();
104
        $course = $this->getDataGenerator()->create_course();
Línea 105... Línea 105...
105
        $folder = $this->getDataGenerator()->create_module('folder', array('course' => $course->id));
105
        $folder = $this->getDataGenerator()->create_module('folder', array('course' => $course->id));
Línea 120... Línea 120...
120
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
120
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
121
        $this->assertEquals(1, $actionevent->get_item_count());
121
        $this->assertEquals(1, $actionevent->get_item_count());
122
        $this->assertTrue($actionevent->is_actionable());
122
        $this->assertTrue($actionevent->is_actionable());
123
    }
123
    }
Línea 124... Línea 124...
124
 
124
 
125
    public function test_folder_core_calendar_provide_event_action_for_non_user() {
125
    public function test_folder_core_calendar_provide_event_action_for_non_user(): void {
Línea 126... Línea 126...
126
        global $CFG;
126
        global $CFG;
127
 
127
 
Línea 147... Línea 147...
147
 
147
 
148
        // Confirm the event is not shown at all.
148
        // Confirm the event is not shown at all.
149
        $this->assertNull($actionevent);
149
        $this->assertNull($actionevent);
Línea 150... Línea 150...
150
    }
150
    }
151
 
151
 
152
    public function test_folder_core_calendar_provide_event_action_in_hidden_section() {
152
    public function test_folder_core_calendar_provide_event_action_in_hidden_section(): void {
Línea 153... Línea 153...
153
        // Create a course.
153
        // Create a course.
154
        $course = $this->getDataGenerator()->create_course();
154
        $course = $this->getDataGenerator()->create_course();
Línea 174... Línea 174...
174
 
174
 
175
        // Confirm the event is not shown at all.
175
        // Confirm the event is not shown at all.
176
        $this->assertNull($actionevent);
176
        $this->assertNull($actionevent);
Línea 177... Línea 177...
177
    }
177
    }
178
 
178
 
179
    public function test_folder_core_calendar_provide_event_action_for_user() {
179
    public function test_folder_core_calendar_provide_event_action_for_user(): void {
Línea 180... Línea 180...
180
        // Create a course.
180
        // Create a course.
181
        $course = $this->getDataGenerator()->create_course();
181
        $course = $this->getDataGenerator()->create_course();
Línea 205... Línea 205...
205
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
205
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
206
        $this->assertEquals(1, $actionevent->get_item_count());
206
        $this->assertEquals(1, $actionevent->get_item_count());
207
        $this->assertTrue($actionevent->is_actionable());
207
        $this->assertTrue($actionevent->is_actionable());
208
    }
208
    }
Línea 209... Línea 209...
209
 
209
 
210
    public function test_folder_core_calendar_provide_event_action_already_completed() {
210
    public function test_folder_core_calendar_provide_event_action_already_completed(): void {
Línea 211... Línea 211...
211
        global $CFG;
211
        global $CFG;
Línea 212... Línea 212...
212
 
212
 
Línea 236... Línea 236...
236
 
236
 
237
        // Ensure result was null.
237
        // Ensure result was null.
238
        $this->assertNull($actionevent);
238
        $this->assertNull($actionevent);
Línea 239... Línea 239...
239
    }
239
    }
240
 
240
 
Línea 241... Línea 241...
241
    public function test_folder_core_calendar_provide_event_action_already_completed_for_user() {
241
    public function test_folder_core_calendar_provide_event_action_already_completed_for_user(): void {
Línea 242... Línea 242...
242
        global $CFG;
242
        global $CFG;
Línea 305... Línea 305...
305
     *
305
     *
306
     * @param int $forcedownload The forcedownload option.
306
     * @param int $forcedownload The forcedownload option.
307
     * @param bool $hascapability if the user has the mod/folder:view capability
307
     * @param bool $hascapability if the user has the mod/folder:view capability
308
     * @param int $count The expected recent activities entries.
308
     * @param int $count The expected recent activities entries.
309
     */
309
     */
310
    public function test_folder_get_recent_mod_activity(int $forcedownload, bool $hascapability, int $count) {
310
    public function test_folder_get_recent_mod_activity(int $forcedownload, bool $hascapability, int $count): void {
311
        global $USER, $DB;
311
        global $USER, $DB;
Línea 312... Línea 312...
312
 
312
 
313
        $this->resetAfterTest();
313
        $this->resetAfterTest();