Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 59... Línea 59...
59
 
59
 
60
    /**
60
    /**
61
     * Test survey_view
61
     * Test survey_view
62
     * @return void
62
     * @return void
63
     */
63
     */
64
    public function test_survey_view() {
64
    public function test_survey_view(): void {
Línea 65... Línea 65...
65
        global $CFG;
65
        global $CFG;
66
 
66
 
Línea 101... Línea 101...
101
    }
101
    }
Línea 102... Línea 102...
102
 
102
 
103
    /**
103
    /**
104
     * Test survey_order_questions
104
     * Test survey_order_questions
105
     */
105
     */
106
    public function test_survey_order_questions() {
106
    public function test_survey_order_questions(): void {
Línea 107... Línea 107...
107
        global $DB;
107
        global $DB;
108
 
108
 
109
        $this->resetAfterTest();
109
        $this->resetAfterTest();
Línea 122... Línea 122...
122
    }
122
    }
Línea 123... Línea 123...
123
 
123
 
124
    /**
124
    /**
125
     * Test survey_save_answers
125
     * Test survey_save_answers
126
     */
126
     */
127
    public function test_survey_save_answers() {
127
    public function test_survey_save_answers(): void {
Línea 128... Línea 128...
128
        global $DB;
128
        global $DB;
129
 
129
 
Línea 175... Línea 175...
175
        $this->assertInstanceOf('\mod_survey\event\response_submitted', $event);
175
        $this->assertInstanceOf('\mod_survey\event\response_submitted', $event);
176
        $this->assertEquals($context, $event->get_context());
176
        $this->assertEquals($context, $event->get_context());
177
        $this->assertEquals($survey->id, $event->other['surveyid']);
177
        $this->assertEquals($survey->id, $event->other['surveyid']);
178
    }
178
    }
Línea 179... Línea 179...
179
 
179
 
180
    public function test_survey_core_calendar_provide_event_action() {
180
    public function test_survey_core_calendar_provide_event_action(): void {
181
        $this->resetAfterTest();
181
        $this->resetAfterTest();
Línea 182... Línea 182...
182
        $this->setAdminUser();
182
        $this->setAdminUser();
183
 
183
 
Línea 201... Línea 201...
201
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
201
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
202
        $this->assertEquals(1, $actionevent->get_item_count());
202
        $this->assertEquals(1, $actionevent->get_item_count());
203
        $this->assertTrue($actionevent->is_actionable());
203
        $this->assertTrue($actionevent->is_actionable());
204
    }
204
    }
Línea 205... Línea 205...
205
 
205
 
206
    public function test_survey_core_calendar_provide_event_action_for_user() {
206
    public function test_survey_core_calendar_provide_event_action_for_user(): void {
Línea 207... Línea 207...
207
        global $CFG;
207
        global $CFG;
208
 
208
 
Línea 236... Línea 236...
236
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
236
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
237
        $this->assertEquals(1, $actionevent->get_item_count());
237
        $this->assertEquals(1, $actionevent->get_item_count());
238
        $this->assertTrue($actionevent->is_actionable());
238
        $this->assertTrue($actionevent->is_actionable());
239
    }
239
    }
Línea 240... Línea 240...
240
 
240
 
241
    public function test_survey_core_calendar_provide_event_action_as_non_user() {
241
    public function test_survey_core_calendar_provide_event_action_as_non_user(): void {
Línea 242... Línea 242...
242
        global $CFG;
242
        global $CFG;
243
 
243
 
Línea 264... Línea 264...
264
 
264
 
265
        // Ensure result was null.
265
        // Ensure result was null.
266
        $this->assertNull($actionevent);
266
        $this->assertNull($actionevent);
Línea 267... Línea 267...
267
    }
267
    }
268
 
268
 
Línea 269... Línea 269...
269
    public function test_survey_core_calendar_provide_event_action_already_completed() {
269
    public function test_survey_core_calendar_provide_event_action_already_completed(): void {
270
        global $CFG;
270
        global $CFG;
Línea 298... Línea 298...
298
 
298
 
299
        // Ensure result was null.
299
        // Ensure result was null.
300
        $this->assertNull($actionevent);
300
        $this->assertNull($actionevent);
Línea 301... Línea 301...
301
    }
301
    }
302
 
302
 
Línea 303... Línea 303...
303
    public function test_survey_core_calendar_provide_event_action_already_completed_for_user() {
303
    public function test_survey_core_calendar_provide_event_action_already_completed_for_user(): void {
304
        global $CFG;
304
        global $CFG;
Línea 365... Línea 365...
365
    /**
365
    /**
366
     * Test the callback responsible for returning the completion rule descriptions.
366
     * Test the callback responsible for returning the completion rule descriptions.
367
     * This function should work given either an instance of the module (cm_info), such as when checking the active rules,
367
     * This function should work given either an instance of the module (cm_info), such as when checking the active rules,
368
     * or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.
368
     * or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.
369
     */
369
     */
370
    public function test_mod_survey_completion_get_active_rule_descriptions() {
370
    public function test_mod_survey_completion_get_active_rule_descriptions(): void {
371
        $this->resetAfterTest();
371
        $this->resetAfterTest();
372
        $this->setAdminUser();
372
        $this->setAdminUser();
Línea 373... Línea 373...
373
 
373
 
374
        // Two activities, both with automatic completion. One has the 'completionsubmit' rule, one doesn't.
374
        // Two activities, both with automatic completion. One has the 'completionsubmit' rule, one doesn't.