Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 74... Línea 74...
74
    }
74
    }
Línea 75... Línea 75...
75
 
75
 
76
    /**
76
    /**
77
     * Test returning metadata.
77
     * Test returning metadata.
78
     */
78
     */
79
    public function test_get_metadata() {
79
    public function test_get_metadata(): void {
80
        $collection = new \core_privacy\local\metadata\collection('message_airnotifier');
80
        $collection = new \core_privacy\local\metadata\collection('message_airnotifier');
81
        $collection = \message_airnotifier\privacy\provider::get_metadata($collection);
81
        $collection = \message_airnotifier\privacy\provider::get_metadata($collection);
82
        $this->assertNotEmpty($collection);
82
        $this->assertNotEmpty($collection);
Línea 83... Línea 83...
83
    }
83
    }
84
 
84
 
85
    /**
85
    /**
86
     * Test getting the context for the user ID related to this plugin.
86
     * Test getting the context for the user ID related to this plugin.
Línea 87... Línea 87...
87
     */
87
     */
88
    public function test_get_contexts_for_userid() {
88
    public function test_get_contexts_for_userid(): void {
Línea 89... Línea 89...
89
 
89
 
Línea 98... Línea 98...
98
    }
98
    }
Línea 99... Línea 99...
99
 
99
 
100
    /**
100
    /**
101
     * Test that data is exported correctly for this plugin.
101
     * Test that data is exported correctly for this plugin.
102
     */
102
     */
103
    public function test_export_user_data() {
103
    public function test_export_user_data(): void {
104
        $user = $this->getDataGenerator()->create_user();
104
        $user = $this->getDataGenerator()->create_user();
Línea 105... Línea 105...
105
        $context = \context_user::instance($user->id);
105
        $context = \context_user::instance($user->id);
106
 
106
 
Línea 121... Línea 121...
121
    }
121
    }
Línea 122... Línea 122...
122
 
122
 
123
    /**
123
    /**
124
     * Test that user data is deleted using the context.
124
     * Test that user data is deleted using the context.
125
     */
125
     */
126
    public function test_delete_data_for_all_users_in_context() {
126
    public function test_delete_data_for_all_users_in_context(): void {
Línea 127... Línea 127...
127
        global $DB;
127
        global $DB;
128
 
128
 
Línea 143... Línea 143...
143
    }
143
    }
Línea 144... Línea 144...
144
 
144
 
145
    /**
145
    /**
146
     * Test that user data is deleted for this user.
146
     * Test that user data is deleted for this user.
147
     */
147
     */
148
    public function test_delete_data_for_user() {
148
    public function test_delete_data_for_user(): void {
Línea 149... Línea 149...
149
        global $DB;
149
        global $DB;
150
 
150
 
Línea 166... Línea 166...
166
    }
166
    }
Línea 167... Línea 167...
167
 
167
 
168
    /**
168
    /**
169
     * Test that only users with a user context are fetched.
169
     * Test that only users with a user context are fetched.
170
     */
170
     */
171
    public function test_get_users_in_context() {
171
    public function test_get_users_in_context(): void {
Línea 172... Línea 172...
172
        $component = 'message_airnotifier';
172
        $component = 'message_airnotifier';
173
 
173
 
174
        // Create user.
174
        // Create user.
Línea 199... Línea 199...
199
    }
199
    }
Línea 200... Línea 200...
200
 
200
 
201
    /**
201
    /**
202
     * Test that data for users in approved userlist is deleted.
202
     * Test that data for users in approved userlist is deleted.
203
     */
203
     */
204
    public function test_delete_data_for_users() {
204
    public function test_delete_data_for_users(): void {
Línea 205... Línea 205...
205
        $component = 'message_airnotifier';
205
        $component = 'message_airnotifier';
206
 
206
 
207
        // Create user1.
207
        // Create user1.