Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 70... Línea 70...
70
    }
70
    }
Línea 71... Línea 71...
71
 
71
 
72
    /**
72
    /**
73
     *  Verify that a collection of metadata is returned for this component and that it just returns the righ types for 'portfolio'.
73
     *  Verify that a collection of metadata is returned for this component and that it just returns the righ types for 'portfolio'.
74
     */
74
     */
75
    public function test_get_metadata() {
75
    public function test_get_metadata(): void {
76
        $collection = new \core_privacy\local\metadata\collection('core_portfolio');
76
        $collection = new \core_privacy\local\metadata\collection('core_portfolio');
77
        $collection = provider::get_metadata($collection);
77
        $collection = provider::get_metadata($collection);
78
        $this->assertNotEmpty($collection);
78
        $this->assertNotEmpty($collection);
79
        $items = $collection->get_collection();
79
        $items = $collection->get_collection();
Línea 85... Línea 85...
85
    }
85
    }
Línea 86... Línea 86...
86
 
86
 
87
    /**
87
    /**
88
     * Test that the export for a user id returns a user context.
88
     * Test that the export for a user id returns a user context.
89
     */
89
     */
90
    public function test_get_contexts_for_userid() {
90
    public function test_get_contexts_for_userid(): void {
91
        $this->resetAfterTest();
91
        $this->resetAfterTest();
92
        $user = $this->getDataGenerator()->create_user();
92
        $user = $this->getDataGenerator()->create_user();
93
        $context = \context_user::instance($user->id);
93
        $context = \context_user::instance($user->id);
94
        $this->create_portfolio_data('googledocs', 'Google Docs', $user, 'visible', 1);
94
        $this->create_portfolio_data('googledocs', 'Google Docs', $user, 'visible', 1);
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    /**
99
    /**
100
     * Test that exporting user data works as expected.
100
     * Test that exporting user data works as expected.
101
     */
101
     */
102
    public function test_export_user_data() {
102
    public function test_export_user_data(): void {
103
        $this->resetAfterTest();
103
        $this->resetAfterTest();
104
        $user = $this->getDataGenerator()->create_user();
104
        $user = $this->getDataGenerator()->create_user();
105
        $context = \context_user::instance($user->id);
105
        $context = \context_user::instance($user->id);
106
        $this->create_portfolio_data('googledocs', 'Google Docs', $user, 'visible', 1);
106
        $this->create_portfolio_data('googledocs', 'Google Docs', $user, 'visible', 1);
Línea 112... Línea 112...
112
    }
112
    }
Línea 113... Línea 113...
113
 
113
 
114
    /**
114
    /**
115
     * Test that deleting only results in the one context being removed.
115
     * Test that deleting only results in the one context being removed.
116
     */
116
     */
117
    public function test_delete_data_for_all_users_in_context() {
117
    public function test_delete_data_for_all_users_in_context(): void {
Línea 118... Línea 118...
118
        global $DB;
118
        global $DB;
119
 
119
 
120
        $this->resetAfterTest();
120
        $this->resetAfterTest();
Línea 139... Línea 139...
139
    }
139
    }
Línea 140... Línea 140...
140
 
140
 
141
    /**
141
    /**
142
     * Test that deleting only results in one user's data being removed.
142
     * Test that deleting only results in one user's data being removed.
143
     */
143
     */
144
    public function test_delete_data_for_user() {
144
    public function test_delete_data_for_user(): void {
Línea 145... Línea 145...
145
        global $DB;
145
        global $DB;
146
 
146
 
147
        $this->resetAfterTest();
147
        $this->resetAfterTest();
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
        $this->resetAfterTest();
172
        $this->resetAfterTest();
173
 
173
 
174
        $component = 'core_portfolio';
174
        $component = 'core_portfolio';
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
        $this->resetAfterTest();
205
        $this->resetAfterTest();
206
 
206
 
207
        $component = 'core_portfolio';
207
        $component = 'core_portfolio';