Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 73... Línea 73...
73
    }
73
    }
Línea 74... Línea 74...
74
 
74
 
75
    /**
75
    /**
76
     * Quick test to make sure that get_metadata returns something.
76
     * Quick test to make sure that get_metadata returns something.
77
     */
77
     */
78
    public function test_get_metadata() {
78
    public function test_get_metadata(): void {
79
        $collection = new \core_privacy\local\metadata\collection('assignsubmission_comments');
79
        $collection = new \core_privacy\local\metadata\collection('assignsubmission_comments');
80
        $collection = \assignsubmission_comments\privacy\provider::get_metadata($collection);
80
        $collection = \assignsubmission_comments\privacy\provider::get_metadata($collection);
81
        $this->assertNotEmpty($collection);
81
        $this->assertNotEmpty($collection);
Línea 82... Línea 82...
82
    }
82
    }
83
 
83
 
84
    /**
84
    /**
85
     * Test returning the context for a user who has made a comment in an assignment.
85
     * Test returning the context for a user who has made a comment in an assignment.
86
     */
86
     */
87
    public function test_get_context_for_userid_within_submission() {
87
    public function test_get_context_for_userid_within_submission(): void {
88
        $this->resetAfterTest();
88
        $this->resetAfterTest();
89
        // Create course, assignment, submission, and then a feedback comment.
89
        // Create course, assignment, submission, and then a feedback comment.
90
        $course = $this->getDataGenerator()->create_course();
90
        $course = $this->getDataGenerator()->create_course();
Línea 110... Línea 110...
110
    }
110
    }
Línea 111... Línea 111...
111
 
111
 
112
    /**
112
    /**
113
     * Test returning student ids given a user ID.
113
     * Test returning student ids given a user ID.
114
     */
114
     */
115
    public function test_get_student_user_ids() {
115
    public function test_get_student_user_ids(): void {
116
        $this->resetAfterTest();
116
        $this->resetAfterTest();
117
        // Create course, assignment, submission, and then a feedback comment.
117
        // Create course, assignment, submission, and then a feedback comment.
118
        $course = $this->getDataGenerator()->create_course();
118
        $course = $this->getDataGenerator()->create_course();
119
        // Student.
119
        // Student.
Línea 138... Línea 138...
138
    }
138
    }
Línea 139... Línea 139...
139
 
139
 
140
    /**
140
    /**
141
     * Test returning users related to a given context.
141
     * Test returning users related to a given context.
142
     */
142
     */
143
    public function test_get_userids_from_context() {
143
    public function test_get_userids_from_context(): void {
144
        // Get a bunch of users making comments.
144
        // Get a bunch of users making comments.
145
        // Some in one context some in another.
145
        // Some in one context some in another.
146
        $this->resetAfterTest();
146
        $this->resetAfterTest();
147
        $course = $this->getDataGenerator()->create_course();
147
        $course = $this->getDataGenerator()->create_course();
Línea 185... Línea 185...
185
    }
185
    }
Línea 186... Línea 186...
186
 
186
 
187
    /**
187
    /**
188
     * Test that comments are exported for a user.
188
     * Test that comments are exported for a user.
189
     */
189
     */
190
    public function test_export_submission_user_data() {
190
    public function test_export_submission_user_data(): void {
191
        $this->resetAfterTest();
191
        $this->resetAfterTest();
192
        // Create course, assignment, submission, and then a feedback comment.
192
        // Create course, assignment, submission, and then a feedback comment.
193
        $course = $this->getDataGenerator()->create_course();
193
        $course = $this->getDataGenerator()->create_course();
194
        // Student.
194
        // Student.
Línea 229... Línea 229...
229
    }
229
    }
Línea 230... Línea 230...
230
 
230
 
231
    /**
231
    /**
232
     * Test that all comments are deleted for this context.
232
     * Test that all comments are deleted for this context.
233
     */
233
     */
234
    public function test_delete_submission_for_context() {
234
    public function test_delete_submission_for_context(): void {
235
        global $DB;
235
        global $DB;
Línea 236... Línea 236...
236
        $this->resetAfterTest();
236
        $this->resetAfterTest();
237
 
237
 
Línea 268... Línea 268...
268
    }
268
    }
Línea 269... Línea 269...
269
 
269
 
270
    /**
270
    /**
271
     * Test that the comments for a user are deleted.
271
     * Test that the comments for a user are deleted.
272
     */
272
     */
273
    public function test_delete_submission_for_userid() {
273
    public function test_delete_submission_for_userid(): void {
274
        global $DB;
274
        global $DB;
275
        $this->resetAfterTest();
275
        $this->resetAfterTest();
276
        // Create course, assignment, submission, and then a feedback comment.
276
        // Create course, assignment, submission, and then a feedback comment.
277
        $course = $this->getDataGenerator()->create_course();
277
        $course = $this->getDataGenerator()->create_course();
Línea 311... Línea 311...
311
    }
311
    }
Línea 312... Línea 312...
312
 
312
 
313
    /**
313
    /**
314
     * Test deletion of all submissions for a context works.
314
     * Test deletion of all submissions for a context works.
315
     */
315
     */
316
    public function test_delete_submissions() {
316
    public function test_delete_submissions(): void {
317
        global $DB;
317
        global $DB;
318
        // Get a bunch of users making comments.
318
        // Get a bunch of users making comments.
319
        // Some in one context some in another.
319
        // Some in one context some in another.
320
        $this->resetAfterTest();
320
        $this->resetAfterTest();