Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 82... Línea 82...
82
     *
82
     *
83
     * @dataProvider null_provider_provider
83
     * @dataProvider null_provider_provider
84
     * @param   string  $component The name of the component.
84
     * @param   string  $component The name of the component.
85
     * @param   string  $classname The name of the class for privacy
85
     * @param   string  $classname The name of the class for privacy
86
     */
86
     */
87
    public function test_null_provider($component, $classname) {
87
    public function test_null_provider($component, $classname): void {
88
        $reason = $classname::get_reason();
88
        $reason = $classname::get_reason();
89
        $this->assertIsString($reason);
89
        $this->assertIsString($reason);
Línea 90... Línea 90...
90
 
90
 
91
        $this->assertIsString(get_string($reason, $component));
91
        $this->assertIsString(get_string($reason, $component));
Línea 111... Línea 111...
111
     *
111
     *
112
     * @dataProvider metadata_provider_provider
112
     * @dataProvider metadata_provider_provider
113
     * @param   string  $component The name of the component.
113
     * @param   string  $component The name of the component.
114
     * @param   string  $classname The name of the class for privacy
114
     * @param   string  $classname The name of the class for privacy
115
     */
115
     */
116
    public function test_metadata_provider($component, $classname) {
116
    public function test_metadata_provider($component, $classname): void {
117
        global $DB;
117
        global $DB;
Línea 118... Línea 118...
118
 
118
 
119
        $collection = new collection($component);
119
        $collection = new collection($component);
120
        $metadata = $classname::get_metadata($collection);
120
        $metadata = $classname::get_metadata($collection);
Línea 172... Línea 172...
172
     *
172
     *
173
     * @dataProvider get_component_list
173
     * @dataProvider get_component_list
174
     * @param string $component frankenstyle component name, e.g. 'mod_assign'
174
     * @param string $component frankenstyle component name, e.g. 'mod_assign'
175
     * @param string $classname the fully qualified provider classname
175
     * @param string $classname the fully qualified provider classname
176
     */
176
     */
177
    public function test_all_providers_compliant($component, $classname) {
177
    public function test_all_providers_compliant($component, $classname): void {
178
        $manager = new manager();
178
        $manager = new manager();
179
        $this->assertTrue($manager->component_is_compliant($component));
179
        $this->assertTrue($manager->component_is_compliant($component));
180
    }
180
    }
Línea 181... Línea 181...
181
 
181
 
182
    /**
182
    /**
183
     * Ensure that providers do not throw an error when processing a deleted user.
183
     * Ensure that providers do not throw an error when processing a deleted user.
184
     *
184
     *
185
     * @dataProvider    is_user_data_provider
185
     * @dataProvider    is_user_data_provider
186
     * @param   string  $component
186
     * @param   string  $component
187
     */
187
     */
188
    public function test_component_understands_deleted_users($component) {
188
    public function test_component_understands_deleted_users($component): void {
Línea 189... Línea 189...
189
        $this->resetAfterTest();
189
        $this->resetAfterTest();
190
 
190
 
Línea 206... Línea 206...
206
     * Ensure that providers do not throw an error when processing a deleted user.
206
     * Ensure that providers do not throw an error when processing a deleted user.
207
     *
207
     *
208
     * @dataProvider    is_user_data_provider
208
     * @dataProvider    is_user_data_provider
209
     * @param   string  $component
209
     * @param   string  $component
210
     */
210
     */
211
    public function test_userdata_provider_implements_userlist($component) {
211
    public function test_userdata_provider_implements_userlist($component): void {
212
        $classname = manager::get_provider_classname_for_component($component);
212
        $classname = manager::get_provider_classname_for_component($component);
213
        $this->assertTrue(is_subclass_of($classname, \core_privacy\local\request\core_userlist_provider::class));
213
        $this->assertTrue(is_subclass_of($classname, \core_privacy\local\request\core_userlist_provider::class));
214
    }
214
    }
Línea 215... Línea 215...
215
 
215
 
Línea 288... Línea 288...
288
    }
288
    }
Línea 289... Línea 289...
289
 
289
 
290
    /**
290
    /**
291
     * Test that all tables with user fields are covered by metadata providers
291
     * Test that all tables with user fields are covered by metadata providers
292
     */
292
     */
293
    public function test_table_coverage() {
293
    public function test_table_coverage(): void {
294
        global $DB;
294
        global $DB;
295
        $dbman = $DB->get_manager();
295
        $dbman = $DB->get_manager();
Línea 296... Línea 296...
296
        $tables = [];
296
        $tables = [];