Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 69... Línea 69...
69
    }
69
    }
Línea 70... Línea 70...
70
 
70
 
71
    /**
71
    /**
72
     * Verify that get_metadata returns the database table mapping.
72
     * Verify that get_metadata returns the database table mapping.
73
     */
73
     */
74
    public function test_get_metadata() {
74
    public function test_get_metadata(): void {
75
        $collection = new collection('enrol_flatfile');
75
        $collection = new collection('enrol_flatfile');
76
        $collection = provider::get_metadata($collection);
76
        $collection = provider::get_metadata($collection);
77
        $collectiondata = $collection->get_collection();
77
        $collectiondata = $collection->get_collection();
78
        $this->assertNotEmpty($collectiondata);
78
        $this->assertNotEmpty($collectiondata);
79
        $this->assertInstanceOf(\core_privacy\local\metadata\types\database_table::class, $collectiondata[0]);
79
        $this->assertInstanceOf(\core_privacy\local\metadata\types\database_table::class, $collectiondata[0]);
Línea 80... Línea 80...
80
    }
80
    }
81
 
81
 
82
    /**
82
    /**
83
     * Verify that the relevant course contexts are returned for users with pending enrolment records.
83
     * Verify that the relevant course contexts are returned for users with pending enrolment records.
84
     */
84
     */
85
    public function test_get_contexts_for_user() {
85
    public function test_get_contexts_for_user(): void {
86
        global $DB;
86
        global $DB;
Línea 87... Línea 87...
87
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
87
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 104... Línea 104...
104
    }
104
    }
Línea 105... Línea 105...
105
 
105
 
106
    /**
106
    /**
107
     * Verify the export includes any future enrolment records for the user.
107
     * Verify the export includes any future enrolment records for the user.
108
     */
108
     */
109
    public function test_export_user_data() {
109
    public function test_export_user_data(): void {
110
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
110
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 111... Línea 111...
111
        $this->create_future_enrolments();
111
        $this->create_future_enrolments();
112
 
112
 
Línea 138... Línea 138...
138
    }
138
    }
Línea 139... Línea 139...
139
 
139
 
140
    /**
140
    /**
141
     * Verify export will limit any future enrolment records to only those contextids provided.
141
     * Verify export will limit any future enrolment records to only those contextids provided.
142
     */
142
     */
143
    public function test_export_user_data_restricted_context_subset() {
143
    public function test_export_user_data_restricted_context_subset(): void {
144
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
144
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 145... Línea 145...
145
        $this->create_future_enrolments();
145
        $this->create_future_enrolments();
146
 
146
 
Línea 166... Línea 166...
166
    }
166
    }
Línea 167... Línea 167...
167
 
167
 
168
    /**
168
    /**
169
     * Verify that records can be deleted by context.
169
     * Verify that records can be deleted by context.
170
     */
170
     */
171
    public function test_delete_data_for_all_users_in_context() {
171
    public function test_delete_data_for_all_users_in_context(): void {
172
        global $DB;
172
        global $DB;
173
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
173
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 174... Línea 174...
174
        $this->create_future_enrolments();
174
        $this->create_future_enrolments();
Línea 179... Línea 179...
179
        // Now, run delete by context and confirm that all records are removed.
179
        // Now, run delete by context and confirm that all records are removed.
180
        provider::delete_data_for_all_users_in_context($this->coursecontext1);
180
        provider::delete_data_for_all_users_in_context($this->coursecontext1);
181
        $this->assertEquals(0, $DB->count_records('enrol_flatfile', ['courseid' => $this->coursecontext1->instanceid]));
181
        $this->assertEquals(0, $DB->count_records('enrol_flatfile', ['courseid' => $this->coursecontext1->instanceid]));
182
    }
182
    }
Línea 183... Línea 183...
183
 
183
 
184
    public function test_delete_data_for_user() {
184
    public function test_delete_data_for_user(): void {
185
        global $DB;
185
        global $DB;
186
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
186
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 187... Línea 187...
187
        $this->create_future_enrolments();
187
        $this->create_future_enrolments();
Línea 207... Línea 207...
207
    }
207
    }
Línea 208... Línea 208...
208
 
208
 
209
    /**
209
    /**
210
     * Test for provider::get_users_in_context().
210
     * Test for provider::get_users_in_context().
211
     */
211
     */
212
    public function test_get_users_in_context() {
212
    public function test_get_users_in_context(): void {
213
        global $DB;
213
        global $DB;
214
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
214
        // Create, via flatfile syncing, the future enrolments entries in the enrol_flatfile table.
Línea 215... Línea 215...
215
        $this->create_future_enrolments();
215
        $this->create_future_enrolments();
Línea 235... Línea 235...
235
    }
235
    }
Línea 236... Línea 236...
236
 
236
 
237
    /**
237
    /**
238
     * Test for provider::delete_data_for_users().
238
     * Test for provider::delete_data_for_users().
239
     */
239
     */
240
    public function test_delete_data_for_users() {
240
    public function test_delete_data_for_users(): void {
Línea 241... Línea 241...
241
        global $DB;
241
        global $DB;
242
 
242