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
 
35
 
36
    /**
36
    /**
37
     * Tests profile_get_custom_fields function and checks it is consistent
37
     * Tests profile_get_custom_fields function and checks it is consistent
38
     * with profile_user_record.
38
     * with profile_user_record.
39
     */
39
     */
40
    public function test_get_custom_fields() {
40
    public function test_get_custom_fields(): void {
41
        $this->resetAfterTest();
41
        $this->resetAfterTest();
Línea 42... Línea 42...
42
        $user = $this->getDataGenerator()->create_user();
42
        $user = $this->getDataGenerator()->create_user();
43
 
43
 
Línea 82... Línea 82...
82
    }
82
    }
Línea 83... Línea 83...
83
 
83
 
84
    /**
84
    /**
85
     * Make sure that all profile fields can be initialised without arguments.
85
     * Make sure that all profile fields can be initialised without arguments.
86
     */
86
     */
87
    public function test_default_constructor() {
87
    public function test_default_constructor(): void {
88
        global $DB, $CFG;
88
        global $DB, $CFG;
89
        require_once($CFG->dirroot . '/user/profile/definelib.php');
89
        require_once($CFG->dirroot . '/user/profile/definelib.php');
90
        $datatypes = profile_list_datatypes();
90
        $datatypes = profile_list_datatypes();
91
        foreach ($datatypes as $datatype => $datatypename) {
91
        foreach ($datatypes as $datatype => $datatypename) {
Línea 98... Línea 98...
98
    }
98
    }
Línea 99... Línea 99...
99
 
99
 
100
    /**
100
    /**
101
     * Test profile_view function
101
     * Test profile_view function
102
     */
102
     */
103
    public function test_profile_view() {
103
    public function test_profile_view(): void {
Línea 104... Línea 104...
104
        global $USER;
104
        global $USER;
Línea 105... Línea 105...
105
 
105
 
Línea 140... Línea 140...
140
    }
140
    }
Línea 141... Línea 141...
141
 
141
 
142
    /**
142
    /**
143
     * Test that {@link user_not_fully_set_up()} takes required custom fields into account.
143
     * Test that {@link user_not_fully_set_up()} takes required custom fields into account.
144
     */
144
     */
145
    public function test_profile_has_required_custom_fields_set() {
145
    public function test_profile_has_required_custom_fields_set(): void {
146
        global $CFG;
146
        global $CFG;
Línea 147... Línea 147...
147
        require_once($CFG->dirroot.'/mnet/lib.php');
147
        require_once($CFG->dirroot.'/mnet/lib.php');
Línea 208... Línea 208...
208
    }
208
    }
Línea 209... Línea 209...
209
 
209
 
210
    /**
210
    /**
211
     * Test that user generator sets the custom profile fields
211
     * Test that user generator sets the custom profile fields
212
     */
212
     */
213
    public function test_profile_fields_in_generator() {
213
    public function test_profile_fields_in_generator(): void {
214
        global $CFG;
214
        global $CFG;
Línea 215... Línea 215...
215
        require_once($CFG->dirroot.'/mnet/lib.php');
215
        require_once($CFG->dirroot.'/mnet/lib.php');
Línea 238... Línea 238...
238
    }
238
    }
Línea 239... Línea 239...
239
 
239
 
240
    /**
240
    /**
241
     * Tests the profile_get_custom_field_data_by_shortname function when working normally.
241
     * Tests the profile_get_custom_field_data_by_shortname function when working normally.
242
     */
242
     */
243
    public function test_profile_get_custom_field_data_by_shortname_normal() {
243
    public function test_profile_get_custom_field_data_by_shortname_normal(): void {
Línea 244... Línea 244...
244
        global $DB;
244
        global $DB;
Línea 245... Línea 245...
245
 
245
 
Línea 270... Línea 270...
270
    }
270
    }
Línea 271... Línea 271...
271
 
271
 
272
    /**
272
    /**
273
     * Tests the profile_get_custom_field_data_by_shortname function with a field that doesn't exist.
273
     * Tests the profile_get_custom_field_data_by_shortname function with a field that doesn't exist.
274
     */
274
     */
275
    public function test_profile_get_custom_field_data_by_shortname_missing() {
275
    public function test_profile_get_custom_field_data_by_shortname_missing(): void {
276
        $this->assertNull(profile_get_custom_field_data_by_shortname('speciality'));
276
        $this->assertNull(profile_get_custom_field_data_by_shortname('speciality'));
Línea 277... Línea 277...
277
    }
277
    }
278
 
278