Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 305... Línea 305...
305
    }
305
    }
Línea 306... Línea 306...
306
 
306
 
307
    /**
307
    /**
308
     * Test we can't create a competency framework with only read permissions.
308
     * Test we can't create a competency framework with only read permissions.
309
     */
309
     */
310
    public function test_create_competency_frameworks_with_read_permissions() {
310
    public function test_create_competency_frameworks_with_read_permissions(): void {
Línea 311... Línea 311...
311
        $this->setUser($this->user);
311
        $this->setUser($this->user);
312
 
312
 
313
        $this->expectException(\required_capability_exception::class);
313
        $this->expectException(\required_capability_exception::class);
Línea 314... Línea 314...
314
        $result = $this->create_competency_framework(1, true);
314
        $result = $this->create_competency_framework(1, true);
315
    }
315
    }
316
 
316
 
317
    /**
317
    /**
318
     * Test we can't create a competency framework with only read permissions.
318
     * Test we can't create a competency framework with only read permissions.
319
     */
319
     */
320
    public function test_create_competency_frameworks_with_read_permissions_in_category() {
320
    public function test_create_competency_frameworks_with_read_permissions_in_category(): void {
321
        $this->setUser($this->catuser);
321
        $this->setUser($this->catuser);
Línea 322... Línea 322...
322
        $this->expectException(\required_capability_exception::class);
322
        $this->expectException(\required_capability_exception::class);
323
        $result = $this->create_competency_framework(1, false);
323
        $result = $this->create_competency_framework(1, false);
324
    }
324
    }
325
 
325
 
326
    /**
326
    /**
327
     * Test we can create a competency framework with manage permissions.
327
     * Test we can create a competency framework with manage permissions.
Línea 328... Línea 328...
328
     */
328
     */
329
    public function test_create_competency_frameworks_with_manage_permissions() {
329
    public function test_create_competency_frameworks_with_manage_permissions(): void {
Línea 343... Línea 343...
343
    }
343
    }
Línea 344... Línea 344...
344
 
344
 
345
    /**
345
    /**
346
     * Test we can create a competency framework with manage permissions.
346
     * Test we can create a competency framework with manage permissions.
347
     */
347
     */
348
    public function test_create_competency_frameworks_with_manage_permissions_in_category() {
348
    public function test_create_competency_frameworks_with_manage_permissions_in_category(): void {
349
        $this->setUser($this->catcreator);
349
        $this->setUser($this->catcreator);
Línea 350... Línea 350...
350
        $result = $this->create_competency_framework(1, false);
350
        $result = $this->create_competency_framework(1, false);
351
 
351
 
Línea 369... Línea 369...
369
    }
369
    }
Línea 370... Línea 370...
370
 
370
 
371
    /**
371
    /**
372
     * Test we cannot create a competency framework with nasty data.
372
     * Test we cannot create a competency framework with nasty data.
373
     */
373
     */
374
    public function test_create_competency_frameworks_with_nasty_data() {
374
    public function test_create_competency_frameworks_with_nasty_data(): void {
375
        $this->setUser($this->creator);
375
        $this->setUser($this->creator);
376
        $framework = array(
376
        $framework = array(
377
            'shortname' => 'short<a href="">',
377
            'shortname' => 'short<a href="">',
378
            'idnumber' => 'id;"number',
378
            'idnumber' => 'id;"number',
Línea 388... Línea 388...
388
    }
388
    }
Línea 389... Línea 389...
389
 
389
 
390
    /**
390
    /**
391
     * Test we can read a competency framework with manage permissions.
391
     * Test we can read a competency framework with manage permissions.
392
     */
392
     */
393
    public function test_read_competency_frameworks_with_manage_permissions() {
393
    public function test_read_competency_frameworks_with_manage_permissions(): void {
394
        $this->setUser($this->creator);
394
        $this->setUser($this->creator);
Línea 395... Línea 395...
395
        $result = $this->create_competency_framework(1, true);
395
        $result = $this->create_competency_framework(1, true);
396
 
396
 
Línea 411... Línea 411...
411
    }
411
    }
Línea 412... Línea 412...
412
 
412
 
413
    /**
413
    /**
414
     * Test we can read a competency framework with manage permissions.
414
     * Test we can read a competency framework with manage permissions.
415
     */
415
     */
416
    public function test_read_competency_frameworks_with_manage_permissions_in_category() {
416
    public function test_read_competency_frameworks_with_manage_permissions_in_category(): void {
Línea 417... Línea 417...
417
        $this->setUser($this->creator);
417
        $this->setUser($this->creator);
418
 
418
 
Línea 446... Línea 446...
446
    }
446
    }
Línea 447... Línea 447...
447
 
447
 
448
    /**
448
    /**
449
     * Test we can read a competency framework with read permissions.
449
     * Test we can read a competency framework with read permissions.
450
     */
450
     */
451
    public function test_read_competency_frameworks_with_read_permissions() {
451
    public function test_read_competency_frameworks_with_read_permissions(): void {
452
        $this->setUser($this->creator);
452
        $this->setUser($this->creator);
Línea 453... Línea 453...
453
        $result = $this->create_competency_framework(1, true);
453
        $result = $this->create_competency_framework(1, true);
454
 
454
 
Línea 470... Línea 470...
470
        $this->assertEquals(true, $result->visible);
470
        $this->assertEquals(true, $result->visible);
471
    }
471
    }
472
    /**
472
    /**
473
     * Test we can read a competency framework with read permissions.
473
     * Test we can read a competency framework with read permissions.
474
     */
474
     */
475
    public function test_read_competency_frameworks_with_read_permissions_in_category() {
475
    public function test_read_competency_frameworks_with_read_permissions_in_category(): void {
476
        $this->setUser($this->creator);
476
        $this->setUser($this->creator);
Línea 477... Línea 477...
477
 
477
 
478
        $insystem = $this->create_competency_framework(1, true);
478
        $insystem = $this->create_competency_framework(1, true);
Línea 505... Línea 505...
505
    }
505
    }
Línea 506... Línea 506...
506
 
506
 
507
    /**
507
    /**
508
     * Test we can delete a competency framework with manage permissions.
508
     * Test we can delete a competency framework with manage permissions.
509
     */
509
     */
510
    public function test_delete_competency_frameworks_with_manage_permissions() {
510
    public function test_delete_competency_frameworks_with_manage_permissions(): void {
511
        $this->setUser($this->creator);
511
        $this->setUser($this->creator);
Línea 512... Línea 512...
512
        $result = $this->create_competency_framework(1, true);
512
        $result = $this->create_competency_framework(1, true);
513
 
513
 
Línea 519... Línea 519...
519
    }
519
    }
Línea 520... Línea 520...
520
 
520
 
521
    /**
521
    /**
522
     * Test we can delete a competency framework with manage permissions.
522
     * Test we can delete a competency framework with manage permissions.
523
     */
523
     */
524
    public function test_delete_competency_frameworks_with_manage_permissions_in_category() {
524
    public function test_delete_competency_frameworks_with_manage_permissions_in_category(): void {
Línea 525... Línea 525...
525
        $this->setUser($this->creator);
525
        $this->setUser($this->creator);
526
 
526
 
Línea 545... Línea 545...
545
    }
545
    }
Línea 546... Línea 546...
546
 
546
 
547
    /**
547
    /**
548
     * Test we can delete a competency framework with read permissions.
548
     * Test we can delete a competency framework with read permissions.
549
     */
549
     */
550
    public function test_delete_competency_frameworks_with_read_permissions() {
550
    public function test_delete_competency_frameworks_with_read_permissions(): void {
551
        $this->setUser($this->creator);
551
        $this->setUser($this->creator);
Línea 552... Línea 552...
552
        $result = $this->create_competency_framework(1, true);
552
        $result = $this->create_competency_framework(1, true);
553
 
553
 
Línea 559... Línea 559...
559
    }
559
    }
Línea 560... Línea 560...
560
 
560
 
561
    /**
561
    /**
562
     * Test we can update a competency framework with manage permissions.
562
     * Test we can update a competency framework with manage permissions.
563
     */
563
     */
564
    public function test_update_competency_frameworks_with_manage_permissions() {
564
    public function test_update_competency_frameworks_with_manage_permissions(): void {
565
        $this->setUser($this->creator);
565
        $this->setUser($this->creator);
Línea 566... Línea 566...
566
        $result = $this->create_competency_framework(1, true);
566
        $result = $this->create_competency_framework(1, true);
Línea 571... Línea 571...
571
    }
571
    }
Línea 572... Línea 572...
572
 
572
 
573
    /**
573
    /**
574
     * Test we can update a competency framework with manage permissions.
574
     * Test we can update a competency framework with manage permissions.
575
     */
575
     */
576
    public function test_update_competency_frameworks_with_manage_permissions_in_category() {
576
    public function test_update_competency_frameworks_with_manage_permissions_in_category(): void {
Línea 577... Línea 577...
577
        $this->setUser($this->creator);
577
        $this->setUser($this->creator);
578
 
578
 
Línea 592... Línea 592...
592
        } catch (\required_capability_exception $e) {
592
        } catch (\required_capability_exception $e) {
593
            // All good.
593
            // All good.
594
        }
594
        }
595
    }
595
    }
Línea 596... Línea 596...
596
 
596
 
597
    public function test_update_framework_scale() {
597
    public function test_update_framework_scale(): void {
598
        $this->setUser($this->creator);
598
        $this->setUser($this->creator);
Línea 599... Línea 599...
599
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
599
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 626... Línea 626...
626
    }
626
    }
Línea 627... Línea 627...
627
 
627
 
628
    /**
628
    /**
629
     * Test we can update a competency framework with read permissions.
629
     * Test we can update a competency framework with read permissions.
630
     */
630
     */
631
    public function test_update_competency_frameworks_with_read_permissions() {
631
    public function test_update_competency_frameworks_with_read_permissions(): void {
632
        $this->setUser($this->creator);
632
        $this->setUser($this->creator);
Línea 633... Línea 633...
633
        $result = $this->create_competency_framework(1, true);
633
        $result = $this->create_competency_framework(1, true);
634
 
634
 
Línea 638... Línea 638...
638
    }
638
    }
Línea 639... Línea 639...
639
 
639
 
640
    /**
640
    /**
641
     * Test we can list and count competency frameworks with manage permissions.
641
     * Test we can list and count competency frameworks with manage permissions.
642
     */
642
     */
643
    public function test_list_and_count_competency_frameworks_with_manage_permissions() {
643
    public function test_list_and_count_competency_frameworks_with_manage_permissions(): void {
644
        $this->setUser($this->creator);
644
        $this->setUser($this->creator);
645
        $result = $this->create_competency_framework(1, true);
645
        $result = $this->create_competency_framework(1, true);
646
        $result = $this->create_competency_framework(2, true);
646
        $result = $this->create_competency_framework(2, true);
647
        $result = $this->create_competency_framework(3, true);
647
        $result = $this->create_competency_framework(3, true);
Línea 669... Línea 669...
669
        $this->assertEquals($this->scale1->id, $result->scaleid);
669
        $this->assertEquals($this->scale1->id, $result->scaleid);
670
        $this->assertEquals($this->scaleconfiguration1, $result->scaleconfiguration);
670
        $this->assertEquals($this->scaleconfiguration1, $result->scaleconfiguration);
671
        $this->assertEquals(true, $result->visible);
671
        $this->assertEquals(true, $result->visible);
672
    }
672
    }
Línea 673... Línea 673...
673
 
673
 
674
    public function test_list_competency_frameworks_with_query() {
674
    public function test_list_competency_frameworks_with_query(): void {
675
        $this->setUser($this->creator);
675
        $this->setUser($this->creator);
676
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
676
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
677
        $framework1 = $lpg->create_framework(array(
677
        $framework1 = $lpg->create_framework(array(
678
            'shortname' => 'shortname_beetroot',
678
            'shortname' => 'shortname_beetroot',
Línea 725... Línea 725...
725
    }
725
    }
Línea 726... Línea 726...
726
 
726
 
727
    /**
727
    /**
728
     * Test we can list and count competency frameworks with read permissions.
728
     * Test we can list and count competency frameworks with read permissions.
729
     */
729
     */
730
    public function test_list_and_count_competency_frameworks_with_read_permissions() {
730
    public function test_list_and_count_competency_frameworks_with_read_permissions(): void {
731
        $this->setUser($this->creator);
731
        $this->setUser($this->creator);
732
        $result = $this->create_competency_framework(1, true);
732
        $result = $this->create_competency_framework(1, true);
733
        $result = $this->create_competency_framework(2, true);
733
        $result = $this->create_competency_framework(2, true);
734
        $result = $this->create_competency_framework(3, true);
734
        $result = $this->create_competency_framework(3, true);
Línea 759... Línea 759...
759
    }
759
    }
Línea 760... Línea 760...
760
 
760
 
761
    /**
761
    /**
762
     * Test we can't create a competency with only read permissions.
762
     * Test we can't create a competency with only read permissions.
763
     */
763
     */
764
    public function test_create_competency_with_read_permissions() {
764
    public function test_create_competency_with_read_permissions(): void {
765
        $framework = $this->getDataGenerator()->get_plugin_generator('core_competency')->create_framework();
765
        $framework = $this->getDataGenerator()->get_plugin_generator('core_competency')->create_framework();
766
        $this->setUser($this->user);
766
        $this->setUser($this->user);
767
        $this->expectException(\required_capability_exception::class);
767
        $this->expectException(\required_capability_exception::class);
768
        $competency = $this->create_competency(1, $framework->get('id'));
768
        $competency = $this->create_competency(1, $framework->get('id'));
Línea 769... Línea 769...
769
    }
769
    }
770
 
770
 
771
    /**
771
    /**
772
     * Test we can create a competency with manage permissions.
772
     * Test we can create a competency with manage permissions.
773
     */
773
     */
774
    public function test_create_competency_with_manage_permissions() {
774
    public function test_create_competency_with_manage_permissions(): void {
775
        $this->setUser($this->creator);
775
        $this->setUser($this->creator);
Línea 776... Línea 776...
776
        $framework = $this->create_competency_framework(1, true);
776
        $framework = $this->create_competency_framework(1, true);
Línea 789... Línea 789...
789
 
789
 
790
 
790
 
791
    /**
791
    /**
792
     * Test we can create a competency with manage permissions.
792
     * Test we can create a competency with manage permissions.
793
     */
793
     */
Línea 794... Línea 794...
794
    public function test_create_competency_with_manage_permissions_in_category() {
794
    public function test_create_competency_with_manage_permissions_in_category(): void {
795
        $this->setUser($this->creator);
795
        $this->setUser($this->creator);
Línea 820... Línea 820...
820
    }
820
    }
Línea 821... Línea 821...
821
 
821
 
822
    /**
822
    /**
823
     * Test we cannot create a competency with nasty data.
823
     * Test we cannot create a competency with nasty data.
824
     */
824
     */
825
    public function test_create_competency_with_nasty_data() {
825
    public function test_create_competency_with_nasty_data(): void {
826
        $this->setUser($this->creator);
826
        $this->setUser($this->creator);
827
        $framework = $this->create_competency_framework(1, true);
827
        $framework = $this->create_competency_framework(1, true);
828
        $competency = array(
828
        $competency = array(
829
            'shortname' => 'shortname<a href="">',
829
            'shortname' => 'shortname<a href="">',
Línea 840... Línea 840...
840
    }
840
    }
Línea 841... Línea 841...
841
 
841
 
842
    /**
842
    /**
843
     * Test we can read a competency with manage permissions.
843
     * Test we can read a competency with manage permissions.
844
     */
844
     */
845
    public function test_read_competencies_with_manage_permissions() {
845
    public function test_read_competencies_with_manage_permissions(): void {
846
        $this->setUser($this->creator);
846
        $this->setUser($this->creator);
847
        $framework = $this->create_competency_framework(1, true);
847
        $framework = $this->create_competency_framework(1, true);
Línea 848... Línea 848...
848
        $competency = $this->create_competency(1, $framework->id);
848
        $competency = $this->create_competency(1, $framework->id);
Línea 863... Línea 863...
863
    }
863
    }
Línea 864... Línea 864...
864
 
864
 
865
    /**
865
    /**
866
     * Test we can read a competency with manage permissions.
866
     * Test we can read a competency with manage permissions.
867
     */
867
     */
868
    public function test_read_competencies_with_manage_permissions_in_category() {
868
    public function test_read_competencies_with_manage_permissions_in_category(): void {
Línea 869... Línea 869...
869
        $this->setUser($this->creator);
869
        $this->setUser($this->creator);
870
 
870
 
Línea 898... Línea 898...
898
    }
898
    }
Línea 899... Línea 899...
899
 
899
 
900
    /**
900
    /**
901
     * Test we can read a competency with read permissions.
901
     * Test we can read a competency with read permissions.
902
     */
902
     */
903
    public function test_read_competencies_with_read_permissions() {
903
    public function test_read_competencies_with_read_permissions(): void {
904
        $this->setUser($this->creator);
904
        $this->setUser($this->creator);
905
        $framework = $this->create_competency_framework(1, true);
905
        $framework = $this->create_competency_framework(1, true);
Línea 906... Línea 906...
906
        $competency = $this->create_competency(1, $framework->id);
906
        $competency = $this->create_competency(1, $framework->id);
Línea 923... Línea 923...
923
    }
923
    }
Línea 924... Línea 924...
924
 
924
 
925
    /**
925
    /**
926
     * Test we can read a competency with read permissions.
926
     * Test we can read a competency with read permissions.
927
     */
927
     */
928
    public function test_read_competencies_with_read_permissions_in_category() {
928
    public function test_read_competencies_with_read_permissions_in_category(): void {
929
        $this->setUser($this->creator);
929
        $this->setUser($this->creator);
930
        $sysframework = $this->create_competency_framework(1, true);
930
        $sysframework = $this->create_competency_framework(1, true);
931
        $insystem = $this->create_competency(1, $sysframework->id);
931
        $insystem = $this->create_competency(1, $sysframework->id);
932
        $catframework = $this->create_competency_framework(2, false);
932
        $catframework = $this->create_competency_framework(2, false);
Línea 957... Línea 957...
957
    }
957
    }
Línea 958... Línea 958...
958
 
958
 
959
    /**
959
    /**
960
     * Test we can delete a competency with manage permissions.
960
     * Test we can delete a competency with manage permissions.
961
     */
961
     */
962
    public function test_delete_competency_with_manage_permissions() {
962
    public function test_delete_competency_with_manage_permissions(): void {
963
        $this->setUser($this->creator);
963
        $this->setUser($this->creator);
964
        $framework = $this->create_competency_framework(1, true);
964
        $framework = $this->create_competency_framework(1, true);
Línea 965... Línea 965...
965
        $result = $this->create_competency(1, $framework->id);
965
        $result = $this->create_competency(1, $framework->id);
Línea 972... Línea 972...
972
    }
972
    }
Línea 973... Línea 973...
973
 
973
 
974
    /**
974
    /**
975
     * Test we can delete a competency with manage permissions.
975
     * Test we can delete a competency with manage permissions.
976
     */
976
     */
977
    public function test_delete_competency_with_manage_permissions_in_category() {
977
    public function test_delete_competency_with_manage_permissions_in_category(): void {
Línea 978... Línea 978...
978
        $this->setUser($this->creator);
978
        $this->setUser($this->creator);
979
 
979
 
980
        $sysframework = $this->create_competency_framework(1, true);
980
        $sysframework = $this->create_competency_framework(1, true);
Línea 998... Línea 998...
998
    }
998
    }
Línea 999... Línea 999...
999
 
999
 
1000
    /**
1000
    /**
1001
     * Test we can delete a competency with read permissions.
1001
     * Test we can delete a competency with read permissions.
1002
     */
1002
     */
1003
    public function test_delete_competency_with_read_permissions() {
1003
    public function test_delete_competency_with_read_permissions(): void {
1004
        $this->setUser($this->creator);
1004
        $this->setUser($this->creator);
1005
        $framework = $this->create_competency_framework(1, true);
1005
        $framework = $this->create_competency_framework(1, true);
Línea 1006... Línea 1006...
1006
        $result = $this->create_competency(1, $framework->id);
1006
        $result = $this->create_competency(1, $framework->id);
Línea 1013... Línea 1013...
1013
    }
1013
    }
Línea 1014... Línea 1014...
1014
 
1014
 
1015
    /**
1015
    /**
1016
     * Test we can update a competency with manage permissions.
1016
     * Test we can update a competency with manage permissions.
1017
     */
1017
     */
1018
    public function test_update_competency_with_manage_permissions() {
1018
    public function test_update_competency_with_manage_permissions(): void {
1019
        $this->setUser($this->creator);
1019
        $this->setUser($this->creator);
1020
        $framework = $this->create_competency_framework(1, true);
1020
        $framework = $this->create_competency_framework(1, true);
Línea 1021... Línea 1021...
1021
        $result = $this->create_competency(1, $framework->id);
1021
        $result = $this->create_competency(1, $framework->id);
Línea 1026... Línea 1026...
1026
    }
1026
    }
Línea 1027... Línea 1027...
1027
 
1027
 
1028
    /**
1028
    /**
1029
     * Test we can update a competency with manage permissions.
1029
     * Test we can update a competency with manage permissions.
1030
     */
1030
     */
1031
    public function test_update_competency_with_manage_permissions_in_category() {
1031
    public function test_update_competency_with_manage_permissions_in_category(): void {
Línea 1032... Línea 1032...
1032
        $this->setUser($this->creator);
1032
        $this->setUser($this->creator);
1033
 
1033
 
1034
        $sysframework = $this->create_competency_framework(1, true);
1034
        $sysframework = $this->create_competency_framework(1, true);
Línea 1051... Línea 1051...
1051
    }
1051
    }
Línea 1052... Línea 1052...
1052
 
1052
 
1053
    /**
1053
    /**
1054
     * Test we can update a competency with read permissions.
1054
     * Test we can update a competency with read permissions.
1055
     */
1055
     */
1056
    public function test_update_competency_with_read_permissions() {
1056
    public function test_update_competency_with_read_permissions(): void {
1057
        $this->setUser($this->creator);
1057
        $this->setUser($this->creator);
1058
        $framework = $this->create_competency_framework(1, true);
1058
        $framework = $this->create_competency_framework(1, true);
Línea 1059... Línea 1059...
1059
        $result = $this->create_competency(1, $framework->id);
1059
        $result = $this->create_competency(1, $framework->id);
Línea 1064... Línea 1064...
1064
    }
1064
    }
Línea 1065... Línea 1065...
1065
 
1065
 
1066
    /**
1066
    /**
1067
     * Test count competencies with filters.
1067
     * Test count competencies with filters.
1068
     */
1068
     */
1069
    public function test_count_competencies_with_filters() {
1069
    public function test_count_competencies_with_filters(): void {
Línea 1070... Línea 1070...
1070
        $this->setUser($this->creator);
1070
        $this->setUser($this->creator);
1071
 
1071
 
1072
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
1072
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 1092... Línea 1092...
1092
    }
1092
    }
Línea 1093... Línea 1093...
1093
 
1093
 
1094
    /**
1094
    /**
1095
     * Test we can list and count competencies with manage permissions.
1095
     * Test we can list and count competencies with manage permissions.
1096
     */
1096
     */
1097
    public function test_list_and_count_competencies_with_manage_permissions() {
1097
    public function test_list_and_count_competencies_with_manage_permissions(): void {
1098
        $this->setUser($this->creator);
1098
        $this->setUser($this->creator);
1099
        $framework = $this->create_competency_framework(1, true);
1099
        $framework = $this->create_competency_framework(1, true);
1100
        $result = $this->create_competency(1, $framework->id);
1100
        $result = $this->create_competency(1, $framework->id);
1101
        $result = $this->create_competency(2, $framework->id);
1101
        $result = $this->create_competency(2, $framework->id);
Línea 1121... Línea 1121...
1121
    }
1121
    }
Línea 1122... Línea 1122...
1122
 
1122
 
1123
    /**
1123
    /**
1124
     * Test we can list and count competencies with read permissions.
1124
     * Test we can list and count competencies with read permissions.
1125
     */
1125
     */
1126
    public function test_list_and_count_competencies_with_read_permissions() {
1126
    public function test_list_and_count_competencies_with_read_permissions(): void {
1127
        $this->setUser($this->creator);
1127
        $this->setUser($this->creator);
1128
        $framework = $this->create_competency_framework(1, true);
1128
        $framework = $this->create_competency_framework(1, true);
1129
        $result = $this->create_competency(1, $framework->id);
1129
        $result = $this->create_competency(1, $framework->id);
1130
        $result = $this->create_competency(2, $framework->id);
1130
        $result = $this->create_competency(2, $framework->id);
Línea 1152... Línea 1152...
1152
    }
1152
    }
Línea 1153... Línea 1153...
1153
 
1153
 
1154
    /**
1154
    /**
1155
     * Test we can search for competencies.
1155
     * Test we can search for competencies.
1156
     */
1156
     */
1157
    public function test_search_competencies_with_read_permissions() {
1157
    public function test_search_competencies_with_read_permissions(): void {
1158
        $this->setUser($this->creator);
1158
        $this->setUser($this->creator);
1159
        $framework = $this->create_competency_framework(1, true);
1159
        $framework = $this->create_competency_framework(1, true);
1160
        $result = $this->create_competency(1, $framework->id);
1160
        $result = $this->create_competency(1, $framework->id);
1161
        $result = $this->create_competency(2, $framework->id);
1161
        $result = $this->create_competency(2, $framework->id);
Línea 1178... Línea 1178...
1178
    }
1178
    }
Línea 1179... Línea 1179...
1179
 
1179
 
1180
    /**
1180
    /**
1181
     * Test plans creation and updates.
1181
     * Test plans creation and updates.
1182
     */
1182
     */
1183
    public function test_create_and_update_plans() {
1183
    public function test_create_and_update_plans(): void {
Línea 1184... Línea 1184...
1184
        $syscontext = \context_system::instance();
1184
        $syscontext = \context_system::instance();
1185
 
1185
 
Línea 1251... Línea 1251...
1251
    }
1251
    }
Línea 1252... Línea 1252...
1252
 
1252
 
1253
    /**
1253
    /**
1254
     * Test complete plan.
1254
     * Test complete plan.
1255
     */
1255
     */
1256
    public function test_complete_plan() {
1256
    public function test_complete_plan(): void {
Línea 1257... Línea 1257...
1257
        $syscontext = \context_system::instance();
1257
        $syscontext = \context_system::instance();
Línea 1258... Línea 1258...
1258
 
1258
 
Línea 1273... Línea 1273...
1273
    }
1273
    }
Línea 1274... Línea 1274...
1274
 
1274
 
1275
    /**
1275
    /**
1276
     * Test reopen plan.
1276
     * Test reopen plan.
1277
     */
1277
     */
1278
    public function test_reopen_plan() {
1278
    public function test_reopen_plan(): void {
Línea 1279... Línea 1279...
1279
        $syscontext = \context_system::instance();
1279
        $syscontext = \context_system::instance();
Línea 1280... Línea 1280...
1280
 
1280
 
Línea 1296... Línea 1296...
1296
    }
1296
    }
Línea 1297... Línea 1297...
1297
 
1297
 
1298
    /**
1298
    /**
1299
     * Test that we can read plans.
1299
     * Test that we can read plans.
1300
     */
1300
     */
1301
    public function test_read_plans() {
1301
    public function test_read_plans(): void {
1302
        global $OUTPUT;
1302
        global $OUTPUT;
Línea 1303... Línea 1303...
1303
        $this->setUser($this->creator);
1303
        $this->setUser($this->creator);
Línea 1440... Línea 1440...
1440
        $this->assertEquals((array)$plan1, external::read_plan($plan1->id));
1440
        $this->assertEquals((array)$plan1, external::read_plan($plan1->id));
1441
        $this->assertEquals((array)$plan2, external::read_plan($plan2->id));
1441
        $this->assertEquals((array)$plan2, external::read_plan($plan2->id));
1442
        $this->assertEquals((array)$plan3, external::read_plan($plan3->id));
1442
        $this->assertEquals((array)$plan3, external::read_plan($plan3->id));
1443
    }
1443
    }
Línea 1444... Línea 1444...
1444
 
1444
 
1445
    public function test_delete_plans() {
1445
    public function test_delete_plans(): void {
Línea 1446... Línea 1446...
1446
        $this->setUser($this->creator);
1446
        $this->setUser($this->creator);
Línea 1447... Línea 1447...
1447
 
1447
 
Línea 1488... Línea 1488...
1488
 
1488
 
1489
        $plan4 = $this->create_plan(4, $this->user->id, 0, plan::STATUS_ACTIVE, 0);
1489
        $plan4 = $this->create_plan(4, $this->user->id, 0, plan::STATUS_ACTIVE, 0);
1490
        $this->assertTrue(external::delete_plan($plan4->id));
1490
        $this->assertTrue(external::delete_plan($plan4->id));
Línea 1491... Línea 1491...
1491
    }
1491
    }
1492
 
1492
 
1493
    public function test_delete_plan_removes_relations() {
1493
    public function test_delete_plan_removes_relations(): void {
1494
        $this->setAdminUser();
1494
        $this->setAdminUser();
Línea 1495... Línea 1495...
1495
        $dg = $this->getDataGenerator();
1495
        $dg = $this->getDataGenerator();
Línea 1516... Línea 1516...
1516
        api::delete_plan($plan->get('id'));
1516
        api::delete_plan($plan->get('id'));
1517
        $this->assertEquals(0, plan_competency::count_records(array('planid' => $plan->get('id'))));
1517
        $this->assertEquals(0, plan_competency::count_records(array('planid' => $plan->get('id'))));
1518
        $this->assertEquals(0, user_competency_plan::count_records(array('planid' => $plan->get('id'), 'userid' => $user->id)));
1518
        $this->assertEquals(0, user_competency_plan::count_records(array('planid' => $plan->get('id'), 'userid' => $user->id)));
1519
    }
1519
    }
Línea 1520... Línea 1520...
1520
 
1520
 
1521
    public function test_list_plan_competencies() {
1521
    public function test_list_plan_competencies(): void {
Línea 1522... Línea 1522...
1522
        $this->setUser($this->creator);
1522
        $this->setUser($this->creator);
1523
 
1523
 
Línea 1594... Línea 1594...
1594
        $this->assertEquals(null, $result[1]['usercompetencyplan']['grade']);
1594
        $this->assertEquals(null, $result[1]['usercompetencyplan']['grade']);
1595
        $this->assertEquals(2, $result[2]['usercompetencyplan']['grade']);
1595
        $this->assertEquals(2, $result[2]['usercompetencyplan']['grade']);
1596
        $this->assertEquals(1, $result[2]['usercompetencyplan']['proficiency']);
1596
        $this->assertEquals(1, $result[2]['usercompetencyplan']['proficiency']);
1597
    }
1597
    }
Línea 1598... Línea 1598...
1598
 
1598
 
1599
    public function test_add_competency_to_template() {
1599
    public function test_add_competency_to_template(): void {
Línea 1600... Línea 1600...
1600
        $this->setUser($this->creator);
1600
        $this->setUser($this->creator);
Línea 1601... Línea 1601...
1601
 
1601
 
Línea 1625... Línea 1625...
1625
        } catch (\moodle_exception $e) {
1625
        } catch (\moodle_exception $e) {
1626
            $this->assertEquals('nopermissions', $e->errorcode);
1626
            $this->assertEquals('nopermissions', $e->errorcode);
1627
        }
1627
        }
1628
    }
1628
    }
Línea 1629... Línea 1629...
1629
 
1629
 
1630
    public function test_remove_competency_from_template() {
1630
    public function test_remove_competency_from_template(): void {
1631
        $syscontext = \context_system::instance();
1631
        $syscontext = \context_system::instance();
1632
        $this->setUser($this->creator);
1632
        $this->setUser($this->creator);
Línea 1633... Línea 1633...
1633
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
1633
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 1665... Línea 1665...
1665
    }
1665
    }
Línea 1666... Línea 1666...
1666
 
1666
 
1667
    /**
1667
    /**
1668
     * Test we can re-order competency frameworks.
1668
     * Test we can re-order competency frameworks.
1669
     */
1669
     */
1670
    public function test_reorder_template_competencies() {
1670
    public function test_reorder_template_competencies(): void {
Línea 1671... Línea 1671...
1671
        $this->setUser($this->creator);
1671
        $this->setUser($this->creator);
1672
 
1672
 
Línea 1732... Línea 1732...
1732
    }
1732
    }
Línea 1733... Línea 1733...
1733
 
1733
 
1734
    /**
1734
    /**
1735
     * Test we can duplicate learning plan template.
1735
     * Test we can duplicate learning plan template.
1736
     */
1736
     */
1737
    public function test_duplicate_learning_plan_template() {
1737
    public function test_duplicate_learning_plan_template(): void {
Línea 1738... Línea 1738...
1738
        $this->setUser($this->creator);
1738
        $this->setUser($this->creator);
1739
 
1739
 
Línea 1770... Línea 1770...
1770
    }
1770
    }
Línea 1771... Línea 1771...
1771
 
1771
 
1772
    /**
1772
    /**
1773
     * Test that we can return scale values for a scale with the scale ID.
1773
     * Test that we can return scale values for a scale with the scale ID.
1774
     */
1774
     */
1775
    public function test_get_scale_values() {
1775
    public function test_get_scale_values(): void {
Línea 1776... Línea 1776...
1776
        global $DB;
1776
        global $DB;
Línea 1777... Línea 1777...
1777
 
1777
 
Línea 1811... Línea 1811...
1811
    }
1811
    }
Línea 1812... Línea 1812...
1812
 
1812
 
1813
    /**
1813
    /**
1814
     * Create a template.
1814
     * Create a template.
1815
     */
1815
     */
1816
    public function test_create_template() {
1816
    public function test_create_template(): void {
1817
        $syscontextid = \context_system::instance()->id;
1817
        $syscontextid = \context_system::instance()->id;
Línea 1818... Línea 1818...
1818
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1818
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1819
 
1819
 
Línea 1863... Línea 1863...
1863
    }
1863
    }
Línea 1864... Línea 1864...
1864
 
1864
 
1865
    /**
1865
    /**
1866
     * Read a template.
1866
     * Read a template.
1867
     */
1867
     */
1868
    public function test_read_template() {
1868
    public function test_read_template(): void {
1869
        $syscontextid = \context_system::instance()->id;
1869
        $syscontextid = \context_system::instance()->id;
Línea 1870... Línea 1870...
1870
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1870
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1871
 
1871
 
Línea 1946... Línea 1946...
1946
    }
1946
    }
Línea 1947... Línea 1947...
1947
 
1947
 
1948
    /**
1948
    /**
1949
     * Update a template.
1949
     * Update a template.
1950
     */
1950
     */
1951
    public function test_update_template() {
1951
    public function test_update_template(): void {
1952
        $syscontextid = \context_system::instance()->id;
1952
        $syscontextid = \context_system::instance()->id;
Línea 1953... Línea 1953...
1953
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1953
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
1954
 
1954
 
Línea 2027... Línea 2027...
2027
    }
2027
    }
Línea 2028... Línea 2028...
2028
 
2028
 
2029
    /**
2029
    /**
2030
     * Delete a template.
2030
     * Delete a template.
2031
     */
2031
     */
2032
    public function test_delete_template() {
2032
    public function test_delete_template(): void {
2033
        global $DB;
2033
        global $DB;
2034
        $syscontextid = \context_system::instance()->id;
2034
        $syscontextid = \context_system::instance()->id;
Línea 2035... Línea 2035...
2035
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
2035
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
Línea 2085... Línea 2085...
2085
    }
2085
    }
Línea 2086... Línea 2086...
2086
 
2086
 
2087
    /**
2087
    /**
2088
     * List templates.
2088
     * List templates.
2089
     */
2089
     */
2090
    public function test_list_templates() {
2090
    public function test_list_templates(): void {
2091
        $syscontextid = \context_system::instance()->id;
2091
        $syscontextid = \context_system::instance()->id;
Línea 2092... Línea 2092...
2092
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
2092
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
2093
 
2093
 
Línea 2131... Línea 2131...
2131
    }
2131
    }
Línea 2132... Línea 2132...
2132
 
2132
 
2133
    /**
2133
    /**
2134
     * List templates using competency.
2134
     * List templates using competency.
2135
     */
2135
     */
2136
    public function test_list_templates_using_competency() {
2136
    public function test_list_templates_using_competency(): void {
Línea 2137... Línea 2137...
2137
        $this->setUser($this->creator);
2137
        $this->setUser($this->creator);
2138
 
2138
 
2139
        // Create a template.
2139
        // Create a template.
Línea 2175... Línea 2175...
2175
        $this->assertEquals($template2->id, $comptemp2->id);
2175
        $this->assertEquals($template2->id, $comptemp2->id);
2176
        $this->assertEquals($template3->id, $comptemp3->id);
2176
        $this->assertEquals($template3->id, $comptemp3->id);
2177
        $this->assertEquals($template4->id, $comptemp4->id);
2177
        $this->assertEquals($template4->id, $comptemp4->id);
2178
    }
2178
    }
Línea 2179... Línea 2179...
2179
 
2179
 
2180
    public function test_count_templates() {
2180
    public function test_count_templates(): void {
2181
        $syscontextid = \context_system::instance()->id;
2181
        $syscontextid = \context_system::instance()->id;
Línea 2182... Línea 2182...
2182
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
2182
        $catcontextid = \context_coursecat::instance($this->category->id)->id;
2183
 
2183
 
Línea 2219... Línea 2219...
2219
    /**
2219
    /**
2220
     * Test that we can add related competencies.
2220
     * Test that we can add related competencies.
2221
     *
2221
     *
2222
     * @return void
2222
     * @return void
2223
     */
2223
     */
2224
    public function test_add_related_competency() {
2224
    public function test_add_related_competency(): void {
2225
        global $DB;
2225
        global $DB;
2226
        $this->setUser($this->creator);
2226
        $this->setUser($this->creator);
Línea 2227... Línea 2227...
2227
 
2227
 
2228
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2228
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 2311... Línea 2311...
2311
    /**
2311
    /**
2312
     * Test that we can remove related competencies.
2312
     * Test that we can remove related competencies.
2313
     *
2313
     *
2314
     * @return void
2314
     * @return void
2315
     */
2315
     */
2316
    public function test_remove_related_competency() {
2316
    public function test_remove_related_competency(): void {
2317
        $this->setUser($this->creator);
2317
        $this->setUser($this->creator);
Línea 2318... Línea 2318...
2318
 
2318
 
2319
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2319
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2320
        $framework = $lpg->create_framework();
2320
        $framework = $lpg->create_framework();
Línea 2347... Línea 2347...
2347
    /**
2347
    /**
2348
     * Test that we can search and include related competencies.
2348
     * Test that we can search and include related competencies.
2349
     *
2349
     *
2350
     * @return void
2350
     * @return void
2351
     */
2351
     */
2352
    public function test_search_competencies_including_related() {
2352
    public function test_search_competencies_including_related(): void {
2353
        $this->setUser($this->creator);
2353
        $this->setUser($this->creator);
Línea 2354... Línea 2354...
2354
 
2354
 
2355
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2355
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2356
        $framework = $lpg->create_framework();
2356
        $framework = $lpg->create_framework();
Línea 2375... Línea 2375...
2375
    /**
2375
    /**
2376
     * Test that we can add competency to plan if we have the right capability.
2376
     * Test that we can add competency to plan if we have the right capability.
2377
     *
2377
     *
2378
     * @return void
2378
     * @return void
2379
     */
2379
     */
2380
    public function test_add_competency_to_plan() {
2380
    public function test_add_competency_to_plan(): void {
2381
        $this->resetAfterTest(true);
2381
        $this->resetAfterTest(true);
2382
        $dg = $this->getDataGenerator();
2382
        $dg = $this->getDataGenerator();
2383
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2383
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2384
        $usermanage = $dg->create_user();
2384
        $usermanage = $dg->create_user();
2385
        $user = $dg->create_user();
2385
        $user = $dg->create_user();
Línea 2437... Línea 2437...
2437
    /**
2437
    /**
2438
     * Test that we can add competency to plan if we have the right capability.
2438
     * Test that we can add competency to plan if we have the right capability.
2439
     *
2439
     *
2440
     * @return void
2440
     * @return void
2441
     */
2441
     */
2442
    public function test_remove_competency_from_plan() {
2442
    public function test_remove_competency_from_plan(): void {
2443
        $this->resetAfterTest(true);
2443
        $this->resetAfterTest(true);
2444
        $dg = $this->getDataGenerator();
2444
        $dg = $this->getDataGenerator();
2445
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2445
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2446
        $usermanage = $dg->create_user();
2446
        $usermanage = $dg->create_user();
2447
        $user = $dg->create_user();
2447
        $user = $dg->create_user();
Línea 2482... Línea 2482...
2482
    /**
2482
    /**
2483
     * Test that we can add competency to plan if we have the right capability.
2483
     * Test that we can add competency to plan if we have the right capability.
2484
     *
2484
     *
2485
     * @return void
2485
     * @return void
2486
     */
2486
     */
2487
    public function test_reorder_plan_competency() {
2487
    public function test_reorder_plan_competency(): void {
2488
        $this->resetAfterTest(true);
2488
        $this->resetAfterTest(true);
2489
        $dg = $this->getDataGenerator();
2489
        $dg = $this->getDataGenerator();
2490
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2490
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2491
        $usermanage = $dg->create_user();
2491
        $usermanage = $dg->create_user();
2492
        $user = $dg->create_user();
2492
        $user = $dg->create_user();
Línea 2547... Línea 2547...
2547
    }
2547
    }
Línea 2548... Línea 2548...
2548
 
2548
 
2549
    /**
2549
    /**
2550
     * Test resolving sortorder when we creating competency.
2550
     * Test resolving sortorder when we creating competency.
2551
     */
2551
     */
2552
    public function test_fix_sortorder_when_creating_competency() {
2552
    public function test_fix_sortorder_when_creating_competency(): void {
2553
        $this->resetAfterTest(true);
2553
        $this->resetAfterTest(true);
2554
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2554
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 2555... Línea 2555...
2555
        $framework = $lpg->create_framework();
2555
        $framework = $lpg->create_framework();
Línea 2564... Línea 2564...
2564
    }
2564
    }
Línea 2565... Línea 2565...
2565
 
2565
 
2566
    /**
2566
    /**
2567
     * Test resolving sortorder when we delete competency.
2567
     * Test resolving sortorder when we delete competency.
2568
     */
2568
     */
2569
    public function test_fix_sortorder_when_delete_competency() {
2569
    public function test_fix_sortorder_when_delete_competency(): void {
2570
        $this->resetAfterTest(true);
2570
        $this->resetAfterTest(true);
2571
        $this->setUser($this->creator);
2571
        $this->setUser($this->creator);
Línea 2572... Línea 2572...
2572
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2572
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 2617... Línea 2617...
2617
    }
2617
    }
Línea 2618... Línea 2618...
2618
 
2618
 
2619
    /**
2619
    /**
2620
     * Test resolving sortorder when moving a competency.
2620
     * Test resolving sortorder when moving a competency.
2621
     */
2621
     */
2622
    public function test_fix_sortorder_when_moving_competency() {
2622
    public function test_fix_sortorder_when_moving_competency(): void {
2623
        $this->resetAfterTest(true);
2623
        $this->resetAfterTest(true);
2624
        $this->setUser($this->creator);
2624
        $this->setUser($this->creator);
Línea 2625... Línea 2625...
2625
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2625
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 2674... Línea 2674...
2674
        $this->assertEquals(0, $c2->get('sortorder'));
2674
        $this->assertEquals(0, $c2->get('sortorder'));
2675
        $this->assertEquals(0, $c2b->get('sortorder'));
2675
        $this->assertEquals(0, $c2b->get('sortorder'));
2676
        $this->assertEquals(2, $c2a->get('sortorder'));
2676
        $this->assertEquals(2, $c2a->get('sortorder'));
2677
    }
2677
    }
Línea 2678... Línea 2678...
2678
 
2678
 
2679
    public function test_grade_competency() {
2679
    public function test_grade_competency(): void {
Línea 2680... Línea 2680...
2680
        global $CFG;
2680
        global $CFG;
2681
 
2681
 
2682
        $this->setUser($this->creator);
2682
        $this->setUser($this->creator);
Línea 2695... Línea 2695...
2695
 
2695
 
2696
        $this->expectException('\required_capability_exception');
2696
        $this->expectException('\required_capability_exception');
2697
        $evidence = external::grade_competency($this->user->id, $c1->get('id'), 1);
2697
        $evidence = external::grade_competency($this->user->id, $c1->get('id'), 1);
Línea 2698... Línea 2698...
2698
    }
2698
    }
2699
 
2699
 
Línea 2700... Línea 2700...
2700
    public function test_grade_competency_in_course() {
2700
    public function test_grade_competency_in_course(): void {
2701
        global $CFG;
2701
        global $CFG;
2702
 
2702
 
Línea 2721... Línea 2721...
2721
 
2721
 
2722
        $this->expectException('\required_capability_exception');
2722
        $this->expectException('\required_capability_exception');
2723
        $evidence = external::grade_competency_in_course($course->id, $this->user->id, $c1->get('id'), 1);
2723
        $evidence = external::grade_competency_in_course($course->id, $this->user->id, $c1->get('id'), 1);
Línea 2724... Línea 2724...
2724
    }
2724
    }
2725
 
2725
 
Línea 2726... Línea 2726...
2726
    public function test_grade_competency_in_plan() {
2726
    public function test_grade_competency_in_plan(): void {
Línea 2727... Línea 2727...
2727
        global $CFG;
2727
        global $CFG;
Línea 2755... Línea 2755...
2755
    }
2755
    }
Línea 2756... Línea 2756...
2756
 
2756
 
2757
    /**
2757
    /**
2758
     * Test update course competency settings.
2758
     * Test update course competency settings.
2759
     */
2759
     */
2760
    public function test_update_course_competency_settings() {
2760
    public function test_update_course_competency_settings(): void {
Línea 2761... Línea 2761...
2761
        $this->resetAfterTest(true);
2761
        $this->resetAfterTest(true);
Línea 2762... Línea 2762...
2762
 
2762
 
Línea 2801... Línea 2801...
2801
    /**
2801
    /**
2802
     * Test that we can list competencies with a filter.
2802
     * Test that we can list competencies with a filter.
2803
     *
2803
     *
2804
     * @return void
2804
     * @return void
2805
     */
2805
     */
2806
    public function test_list_competencies_with_filter() {
2806
    public function test_list_competencies_with_filter(): void {
2807
        $this->resetAfterTest(true);
2807
        $this->resetAfterTest(true);
2808
        $this->setAdminUser();
2808
        $this->setAdminUser();
2809
        $dg = $this->getDataGenerator();
2809
        $dg = $this->getDataGenerator();
2810
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2810
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
Línea 2840... Línea 2840...
2840
    /**
2840
    /**
2841
     * Test that we can list competencies with a course module.
2841
     * Test that we can list competencies with a course module.
2842
     *
2842
     *
2843
     * @return void
2843
     * @return void
2844
     */
2844
     */
2845
    public function test_list_competencies_with_course_module() {
2845
    public function test_list_competencies_with_course_module(): void {
2846
        $this->resetAfterTest(true);
2846
        $this->resetAfterTest(true);
2847
        $this->setAdminUser();
2847
        $this->setAdminUser();
2848
        $dg = $this->getDataGenerator();
2848
        $dg = $this->getDataGenerator();
2849
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2849
        $lpg = $this->getDataGenerator()->get_plugin_generator('core_competency');
2850
        $course = $dg->create_course();
2850
        $course = $dg->create_course();