Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 35... Línea 35...
35
class lib_test extends \advanced_testcase {
35
class lib_test extends \advanced_testcase {
Línea 36... Línea 36...
36
 
36
 
37
    /**
37
    /**
38
     * Test that a new group with the name of the cohort is created.
38
     * Test that a new group with the name of the cohort is created.
39
     */
39
     */
40
    public function test_enrol_cohort_create_new_group() {
40
    public function test_enrol_cohort_create_new_group(): void {
41
        global $DB;
41
        global $DB;
42
        $this->resetAfterTest();
42
        $this->resetAfterTest();
43
        // Create a category.
43
        // Create a category.
44
        $category = $this->getDataGenerator()->create_category();
44
        $category = $this->getDataGenerator()->create_category();
Línea 81... Línea 81...
81
    }
81
    }
Línea 82... Línea 82...
82
 
82
 
83
    /**
83
    /**
84
     * Test for getting user enrolment actions.
84
     * Test for getting user enrolment actions.
85
     */
85
     */
86
    public function test_get_user_enrolment_actions() {
86
    public function test_get_user_enrolment_actions(): void {
87
        global $CFG, $PAGE;
87
        global $CFG, $PAGE;
Línea 88... Línea 88...
88
        $this->resetAfterTest();
88
        $this->resetAfterTest();
89
 
89
 
Línea 130... Línea 130...
130
        $actions = $plugin->get_user_enrolment_actions($manager, $ue);
130
        $actions = $plugin->get_user_enrolment_actions($manager, $ue);
131
        // Cohort-sync has enrol actions for suspended students -- unenrol.
131
        // Cohort-sync has enrol actions for suspended students -- unenrol.
132
        $this->assertCount(1, $actions);
132
        $this->assertCount(1, $actions);
133
    }
133
    }
Línea 134... Línea 134...
134
 
134
 
135
    public function test_enrol_cohort_unenrolaction_suspend_only() {
135
    public function test_enrol_cohort_unenrolaction_suspend_only(): void {
136
        global $CFG, $DB, $PAGE;
136
        global $CFG, $DB, $PAGE;
Línea 137... Línea 137...
137
        $this->resetAfterTest();
137
        $this->resetAfterTest();
Línea 213... Línea 213...
213
    /**
213
    /**
214
     * Test the behaviour of validate_plugin_data_context().
214
     * Test the behaviour of validate_plugin_data_context().
215
     *
215
     *
216
     * @covers ::validate_plugin_data_context
216
     * @covers ::validate_plugin_data_context
217
     */
217
     */
218
    public function test_validate_plugin_data_context() {
218
    public function test_validate_plugin_data_context(): void {
219
        $this->resetAfterTest();
219
        $this->resetAfterTest();
Línea 220... Línea 220...
220
 
220
 
Línea 221... Línea 221...
221
        $cohortplugin = enrol_get_plugin('cohort');
221
        $cohortplugin = enrol_get_plugin('cohort');
Línea 258... Línea 258...
258
    /**
258
    /**
259
     * Test the behaviour of fill_enrol_custom_fields().
259
     * Test the behaviour of fill_enrol_custom_fields().
260
     *
260
     *
261
     * @covers ::fill_enrol_custom_fields
261
     * @covers ::fill_enrol_custom_fields
262
     */
262
     */
263
    public function test_fill_enrol_custom_fields() {
263
    public function test_fill_enrol_custom_fields(): void {
264
        $this->resetAfterTest();
264
        $this->resetAfterTest();
Línea 265... Línea 265...
265
 
265
 
Línea 266... Línea 266...
266
        $cohortplugin = enrol_get_plugin('cohort');
266
        $cohortplugin = enrol_get_plugin('cohort');
Línea 313... Línea 313...
313
    /**
313
    /**
314
     * Test the behaviour of validate_enrol_plugin_data().
314
     * Test the behaviour of validate_enrol_plugin_data().
315
     *
315
     *
316
     * @covers ::validate_enrol_plugin_data
316
     * @covers ::validate_enrol_plugin_data
317
     */
317
     */
318
    public function test_validate_enrol_plugin_data() {
318
    public function test_validate_enrol_plugin_data(): void {
319
        $this->resetAfterTest();
319
        $this->resetAfterTest();
320
        $this->setAdminUser();
320
        $this->setAdminUser();
Línea 321... Línea 321...
321
 
321
 
322
        $cat = $this->getDataGenerator()->create_category();
322
        $cat = $this->getDataGenerator()->create_category();
Línea 405... Línea 405...
405
    /**
405
    /**
406
     * Test the behaviour of find_instance().
406
     * Test the behaviour of find_instance().
407
     *
407
     *
408
     * @covers ::find_instance
408
     * @covers ::find_instance
409
     */
409
     */
410
    public function test_find_instance() {
410
    public function test_find_instance(): void {
411
        global $DB;
411
        global $DB;
412
        $this->resetAfterTest();
412
        $this->resetAfterTest();
Línea 413... Línea 413...
413
 
413
 
414
        $cat = $this->getDataGenerator()->create_category();
414
        $cat = $this->getDataGenerator()->create_category();