Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 45... Línea 45...
45
    }
45
    }
Línea 46... Línea 46...
46
 
46
 
47
    /**
47
    /**
48
     * Test getting the context for the user ID related to this plugin.
48
     * Test getting the context for the user ID related to this plugin.
49
     */
49
     */
50
    public function test_get_contexts_for_userid() {
50
    public function test_get_contexts_for_userid(): void {
51
        global $DB;
51
        global $DB;
52
        // Create profile category.
52
        // Create profile category.
53
        $categoryid = $this->add_profile_category();
53
        $categoryid = $this->add_profile_category();
54
        // Create profile field.
54
        // Create profile field.
Línea 66... Línea 66...
66
    }
66
    }
Línea 67... Línea 67...
67
 
67
 
68
    /**
68
    /**
69
     * Test that data is exported correctly for this plugin.
69
     * Test that data is exported correctly for this plugin.
70
     */
70
     */
71
    public function test_export_user_data() {
71
    public function test_export_user_data(): void {
72
        // Create profile category.
72
        // Create profile category.
73
        $categoryid = $this->add_profile_category();
73
        $categoryid = $this->add_profile_category();
74
        // Create datetime profile field.
74
        // Create datetime profile field.
75
        $datetimeprofilefieldid = $this->add_profile_field($categoryid, 'datetime');
75
        $datetimeprofilefieldid = $this->add_profile_field($categoryid, 'datetime');
Línea 94... Línea 94...
94
    }
94
    }
Línea 95... Línea 95...
95
 
95
 
96
    /**
96
    /**
97
     * Test that user data is deleted using the context.
97
     * Test that user data is deleted using the context.
98
     */
98
     */
99
    public function test_delete_data_for_all_users_in_context() {
99
    public function test_delete_data_for_all_users_in_context(): void {
100
        global $DB;
100
        global $DB;
101
        // Create profile category.
101
        // Create profile category.
102
        $categoryid = $this->add_profile_category();
102
        $categoryid = $this->add_profile_category();
103
        // Create datetime profile field.
103
        // Create datetime profile field.
Línea 122... Línea 122...
122
    }
122
    }
Línea 123... Línea 123...
123
 
123
 
124
    /**
124
    /**
125
     * Test that user data is deleted for this user.
125
     * Test that user data is deleted for this user.
126
     */
126
     */
127
    public function test_delete_data_for_user() {
127
    public function test_delete_data_for_user(): void {
128
        global $DB;
128
        global $DB;
129
        // Create profile category.
129
        // Create profile category.
130
        $categoryid = $this->add_profile_category();
130
        $categoryid = $this->add_profile_category();
131
        // Create datetime profile field.
131
        // Create datetime profile field.
Línea 152... Línea 152...
152
    }
152
    }
Línea 153... Línea 153...
153
 
153
 
154
    /**
154
    /**
155
     * Test that only users with a user context are fetched.
155
     * Test that only users with a user context are fetched.
156
     */
156
     */
157
    public function test_get_users_in_context() {
157
    public function test_get_users_in_context(): void {
Línea 158... Línea 158...
158
        $this->resetAfterTest();
158
        $this->resetAfterTest();
Línea 159... Línea 159...
159
 
159
 
Línea 190... Línea 190...
190
    }
190
    }
Línea 191... Línea 191...
191
 
191
 
192
    /**
192
    /**
193
     * Test that data for users in approved userlist is deleted.
193
     * Test that data for users in approved userlist is deleted.
194
     */
194
     */
195
    public function test_delete_data_for_users() {
195
    public function test_delete_data_for_users(): void {
Línea 196... Línea 196...
196
        $this->resetAfterTest();
196
        $this->resetAfterTest();
197
 
197
 
198
        $component = 'profilefield_datetime';
198
        $component = 'profilefield_datetime';