Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 200... Línea 200...
200
    }
200
    }
Línea 201... Línea 201...
201
 
201
 
202
    /**
202
    /**
203
     * Test for provider::get_metadata().
203
     * Test for provider::get_metadata().
204
     */
204
     */
205
    public function test_get_metadata() {
205
    public function test_get_metadata(): void {
206
        $collection = new collection('enrol_paypal');
206
        $collection = new collection('enrol_paypal');
207
        $newcollection = provider::get_metadata($collection);
207
        $newcollection = provider::get_metadata($collection);
208
        $itemcollection = $newcollection->get_collection();
208
        $itemcollection = $newcollection->get_collection();
Línea 247... Línea 247...
247
    }
247
    }
Línea 248... Línea 248...
248
 
248
 
249
    /**
249
    /**
250
     * Test for provider::get_contexts_for_userid().
250
     * Test for provider::get_contexts_for_userid().
251
     */
251
     */
252
    public function test_get_contexts_for_userid() {
252
    public function test_get_contexts_for_userid(): void {
253
        $coursecontext1 = \context_course::instance($this->course1->id);
253
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 254... Línea 254...
254
        $coursecontext2 = \context_course::instance($this->course2->id);
254
        $coursecontext2 = \context_course::instance($this->course2->id);
255
 
255
 
Línea 270... Línea 270...
270
    }
270
    }
Línea 271... Línea 271...
271
 
271
 
272
    /**
272
    /**
273
     * Test for provider::get_contexts_for_userid with a user who is a receiver.
273
     * Test for provider::get_contexts_for_userid with a user who is a receiver.
274
     */
274
     */
275
    public function test_get_contexts_for_userid_receiver() {
275
    public function test_get_contexts_for_userid_receiver(): void {
276
        $coursecontext1 = \context_course::instance($this->course1->id);
276
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 277... Línea 277...
277
        $coursecontext2 = \context_course::instance($this->course2->id);
277
        $coursecontext2 = \context_course::instance($this->course2->id);
278
 
278
 
Línea 292... Línea 292...
292
    }
292
    }
Línea 293... Línea 293...
293
 
293
 
294
    /**
294
    /**
295
     * Test for provider::get_contexts_for_userid with a user who is a business.
295
     * Test for provider::get_contexts_for_userid with a user who is a business.
296
     */
296
     */
297
    public function test_get_contexts_for_userid_business() {
297
    public function test_get_contexts_for_userid_business(): void {
298
        $coursecontext1 = \context_course::instance($this->course1->id);
298
        $coursecontext1 = \context_course::instance($this->course1->id);
299
        $coursecontext2 = \context_course::instance($this->course2->id);
299
        $coursecontext2 = \context_course::instance($this->course2->id);
Línea 300... Línea 300...
300
        $coursecontext3 = \context_course::instance($this->course3->id);
300
        $coursecontext3 = \context_course::instance($this->course3->id);
Línea 315... Línea 315...
315
    }
315
    }
Línea 316... Línea 316...
316
 
316
 
317
    /**
317
    /**
318
     * Test for provider::export_user_data().
318
     * Test for provider::export_user_data().
319
     */
319
     */
320
    public function test_export_user_data() {
320
    public function test_export_user_data(): void {
Línea 321... Línea 321...
321
        $coursecontext1 = \context_course::instance($this->course1->id);
321
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 322... Línea 322...
322
 
322
 
Línea 332... Línea 332...
332
    }
332
    }
Línea 333... Línea 333...
333
 
333
 
334
    /**
334
    /**
335
     * Test for provider::export_user_data() when user is not enrolled.
335
     * Test for provider::export_user_data() when user is not enrolled.
336
     */
336
     */
337
    public function test_export_user_data_not_enrolled() {
337
    public function test_export_user_data_not_enrolled(): void {
Línea 338... Línea 338...
338
        $coursecontext1 = \context_course::instance($this->course1->id);
338
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 339... Línea 339...
339
 
339
 
Línea 346... Línea 346...
346
    }
346
    }
Línea 347... Línea 347...
347
 
347
 
348
    /**
348
    /**
349
     * Test for provider::export_user_data() when user has no enrolment.
349
     * Test for provider::export_user_data() when user has no enrolment.
350
     */
350
     */
351
    public function test_export_user_data_no_enrolment() {
351
    public function test_export_user_data_no_enrolment(): void {
Línea 352... Línea 352...
352
        $coursecontext1 = \context_course::instance($this->course1->id);
352
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 353... Línea 353...
353
 
353
 
354
        $this->setUser($this->student0);
354
        $this->setUser($this->student0);
355
 
355
 
356
        // Export all of the data for the context.
356
        // Export all of the data for the context.
357
        $this->export_context_data_for_user($this->student0->id, $coursecontext1, 'enrol_paypal');
357
        $this->export_context_data_for_user($this->student0->id, $coursecontext1, 'enrol_paypal');
Línea 358... Línea 358...
358
        $writer = writer::with_context($coursecontext1);
358
        $writer = writer::with_context($coursecontext1);
359
        $this->assertFalse($writer->has_any_data());
359
        $this->assertFalse($writer->has_any_data());
Línea 360... Línea 360...
360
    }
360
    }
361
 
361
 
362
    public function test_export_user_data_multiple_paypal_history() {
362
    public function test_export_user_data_multiple_paypal_history(): void {
Línea 376... Línea 376...
376
    }
376
    }
Línea 377... Línea 377...
377
 
377
 
378
    /**
378
    /**
379
     * Test for provider::delete_data_for_all_users_in_context().
379
     * Test for provider::delete_data_for_all_users_in_context().
380
     */
380
     */
381
    public function test_delete_data_for_all_users_in_context() {
381
    public function test_delete_data_for_all_users_in_context(): void {
Línea 382... Línea 382...
382
        global $DB;
382
        global $DB;
383
 
383
 
Línea 409... Línea 409...
409
    }
409
    }
Línea 410... Línea 410...
410
 
410
 
411
    /**
411
    /**
412
     * Test for provider::delete_data_for_all_users_in_context() when there is multiple transaction histories for a user.
412
     * Test for provider::delete_data_for_all_users_in_context() when there is multiple transaction histories for a user.
413
     */
413
     */
414
    public function test_delete_data_for_all_users_in_context_multiple_transactions() {
414
    public function test_delete_data_for_all_users_in_context_multiple_transactions(): void {
Línea 415... Línea 415...
415
        global $DB;
415
        global $DB;
416
 
416
 
Línea 442... Línea 442...
442
    }
442
    }
Línea 443... Línea 443...
443
 
443
 
444
    /**
444
    /**
445
     * Test for provider::delete_data_for_user() when student is enrolled in multiple courses and deleting from one of them.
445
     * Test for provider::delete_data_for_user() when student is enrolled in multiple courses and deleting from one of them.
446
     */
446
     */
447
    public function test_delete_data_for_user_from_single_context() {
447
    public function test_delete_data_for_user_from_single_context(): void {
Línea 448... Línea 448...
448
        global $DB;
448
        global $DB;
Línea 449... Línea 449...
449
 
449
 
Línea 495... Línea 495...
495
    }
495
    }
Línea 496... Línea 496...
496
 
496
 
497
    /**
497
    /**
498
     * Test for provider::delete_data_for_user() when student is enrolled in multiple courses and deleting from all of them.
498
     * Test for provider::delete_data_for_user() when student is enrolled in multiple courses and deleting from all of them.
499
     */
499
     */
500
    public function test_delete_data_for_user_from_multiple_context() {
500
    public function test_delete_data_for_user_from_multiple_context(): void {
Línea 501... Línea 501...
501
        global $DB;
501
        global $DB;
502
 
502
 
Línea 549... Línea 549...
549
    }
549
    }
Línea 550... Línea 550...
550
 
550
 
551
    /**
551
    /**
552
     * Test for provider::delete_data_for_user() when user is not enrolled, but is the receiver of the payment.
552
     * Test for provider::delete_data_for_user() when user is not enrolled, but is the receiver of the payment.
553
     */
553
     */
554
    public function test_delete_data_for_user_for_business_user() {
554
    public function test_delete_data_for_user_for_business_user(): void {
Línea 555... Línea 555...
555
        global $DB;
555
        global $DB;
Línea 556... Línea 556...
556
 
556
 
Línea 594... Línea 594...
594
    }
594
    }
Línea 595... Línea 595...
595
 
595
 
596
    /**
596
    /**
597
     * Test for provider::delete_data_for_user() when user is not enrolled, but is the receiver of the payment.
597
     * Test for provider::delete_data_for_user() when user is not enrolled, but is the receiver of the payment.
598
     */
598
     */
599
    public function test_delete_data_for_user_for_receiver_user() {
599
    public function test_delete_data_for_user_for_receiver_user(): void {
Línea 600... Línea 600...
600
        global $DB;
600
        global $DB;
Línea 601... Línea 601...
601
 
601
 
Línea 665... Línea 665...
665
    }
665
    }
Línea 666... Línea 666...
666
 
666
 
667
    /**
667
    /**
668
     * Test for provider::get_users_in_context().
668
     * Test for provider::get_users_in_context().
669
     */
669
     */
670
    public function test_get_users_in_context() {
670
    public function test_get_users_in_context(): void {
671
        $coursecontext1 = \context_course::instance($this->course1->id);
671
        $coursecontext1 = \context_course::instance($this->course1->id);
672
        $coursecontext2 = \context_course::instance($this->course2->id);
672
        $coursecontext2 = \context_course::instance($this->course2->id);
Línea 673... Línea 673...
673
        $coursecontext3 = \context_course::instance($this->course3->id);
673
        $coursecontext3 = \context_course::instance($this->course3->id);
Línea 711... Línea 711...
711
    }
711
    }
Línea 712... Línea 712...
712
 
712
 
713
    /**
713
    /**
714
     * Test for provider::delete_data_for_users().
714
     * Test for provider::delete_data_for_users().
715
     */
715
     */
716
    public function test_delete_data_for_users() {
716
    public function test_delete_data_for_users(): void {
Línea 717... Línea 717...
717
        global $DB;
717
        global $DB;
Línea 718... Línea 718...
718
 
718
 
Línea 771... Línea 771...
771
    }
771
    }
Línea 772... Línea 772...
772
 
772
 
773
    /**
773
    /**
774
     * Test for provider::delete_data_for_users() for business user deletion.
774
     * Test for provider::delete_data_for_users() for business user deletion.
775
     */
775
     */
776
    public function test_delete_data_for_users_business() {
776
    public function test_delete_data_for_users_business(): void {
Línea 777... Línea 777...
777
        global $DB;
777
        global $DB;
Línea 778... Línea 778...
778
 
778
 
Línea 806... Línea 806...
806
    }
806
    }
Línea 807... Línea 807...
807
 
807
 
808
    /**
808
    /**
809
     * Test for provider::delete_data_for_users() for receiver user deletion.
809
     * Test for provider::delete_data_for_users() for receiver user deletion.
810
     */
810
     */
811
    public function test_delete_data_for_users_receiver() {
811
    public function test_delete_data_for_users_receiver(): void {
Línea 812... Línea 812...
812
        global $DB;
812
        global $DB;
Línea 813... Línea 813...
813
 
813