Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 74... Línea 74...
74
     *   - action_category_show
74
     *   - action_category_show
75
     *
75
     *
76
     * In order to show/hide the user must have moodle/category:manage on the parent context.
76
     * In order to show/hide the user must have moodle/category:manage on the parent context.
77
     * In order to view hidden categories the user must have moodle/category:viewhiddencategories
77
     * In order to view hidden categories the user must have moodle/category:viewhiddencategories
78
     */
78
     */
79
    public function test_action_category_hide_and_show() {
79
    public function test_action_category_hide_and_show(): void {
80
        global $DB;
80
        global $DB;
81
        $this->resetAfterTest(true);
81
        $this->resetAfterTest(true);
Línea 82... Línea 82...
82
 
82
 
83
        $generator = $this->getDataGenerator();
83
        $generator = $this->getDataGenerator();
Línea 232... Línea 232...
232
    /**
232
    /**
233
     * Tests hiding and showing of a category by its ID.
233
     * Tests hiding and showing of a category by its ID.
234
     *
234
     *
235
     * This mimics the logic of {@link test_action_category_hide_and_show()}
235
     * This mimics the logic of {@link test_action_category_hide_and_show()}
236
     */
236
     */
237
    public function test_action_category_hide_and_show_by_id() {
237
    public function test_action_category_hide_and_show_by_id(): void {
238
        global $DB;
238
        global $DB;
239
        $this->resetAfterTest(true);
239
        $this->resetAfterTest(true);
Línea 240... Línea 240...
240
 
240
 
241
        $generator = $this->getDataGenerator();
241
        $generator = $this->getDataGenerator();
Línea 387... Línea 387...
387
    }
387
    }
Línea 388... Línea 388...
388
 
388
 
389
    /**
389
    /**
390
     * Test moving courses between categories.
390
     * Test moving courses between categories.
391
     */
391
     */
392
    public function test_action_category_move_courses_into() {
392
    public function test_action_category_move_courses_into(): void {
393
        global $DB, $CFG;
393
        global $DB, $CFG;
Línea 394... Línea 394...
394
        $this->resetAfterTest(true);
394
        $this->resetAfterTest(true);
395
 
395
 
Línea 522... Línea 522...
522
    }
522
    }
Línea 523... Línea 523...
523
 
523
 
524
    /**
524
    /**
525
     * Test moving a categories up and down.
525
     * Test moving a categories up and down.
526
     */
526
     */
527
    public function test_action_category_movedown_and_moveup() {
527
    public function test_action_category_movedown_and_moveup(): void {
528
        global $DB;
528
        global $DB;
Línea 529... Línea 529...
529
        $this->resetAfterTest(true);
529
        $this->resetAfterTest(true);
530
 
530
 
Línea 657... Línea 657...
657
    /**
657
    /**
658
     * Test resorting of courses within a category.
658
     * Test resorting of courses within a category.
659
     *
659
     *
660
     * \core_course\management\helper::action_category_resort_courses
660
     * \core_course\management\helper::action_category_resort_courses
661
     */
661
     */
662
    public function test_action_category_resort_courses() {
662
    public function test_action_category_resort_courses(): void {
663
        global $DB;
663
        global $DB;
664
        $this->resetAfterTest(true);
664
        $this->resetAfterTest(true);
Línea 665... Línea 665...
665
 
665
 
666
        $generator = $this->getDataGenerator();
666
        $generator = $this->getDataGenerator();
Línea 759... Línea 759...
759
    /**
759
    /**
760
     * Tests resorting sub categories of a course.
760
     * Tests resorting sub categories of a course.
761
     *
761
     *
762
     * \core_course\management\helper::action_category_resort_courses
762
     * \core_course\management\helper::action_category_resort_courses
763
     */
763
     */
764
    public function test_action_category_resort_subcategories() {
764
    public function test_action_category_resort_subcategories(): void {
765
        global $DB;
765
        global $DB;
766
        $this->resetAfterTest(true);
766
        $this->resetAfterTest(true);
Línea 767... Línea 767...
767
 
767
 
768
        $generator = $this->getDataGenerator();
768
        $generator = $this->getDataGenerator();
Línea 855... Línea 855...
855
     * Test hiding and showing of a course.
855
     * Test hiding and showing of a course.
856
     *
856
     *
857
     * @see \core_course\management\helper::action_course_hide
857
     * @see \core_course\management\helper::action_course_hide
858
     * @see \core_course\management\helper::action_course_show
858
     * @see \core_course\management\helper::action_course_show
859
     */
859
     */
860
    public function test_action_course_hide_show() {
860
    public function test_action_course_hide_show(): void {
861
        $this->resetAfterTest(true);
861
        $this->resetAfterTest(true);
Línea 862... Línea 862...
862
 
862
 
863
        $generator = $this->getDataGenerator();
863
        $generator = $this->getDataGenerator();
864
        $category = $generator->create_category();
864
        $category = $generator->create_category();
Línea 919... Línea 919...
919
     * Test hiding and showing of a course.
919
     * Test hiding and showing of a course.
920
     *
920
     *
921
     * @see \core_course\management\helper::action_course_hide_by_record
921
     * @see \core_course\management\helper::action_course_hide_by_record
922
     * @see \core_course\management\helper::action_course_show_by_record
922
     * @see \core_course\management\helper::action_course_show_by_record
923
     */
923
     */
924
    public function test_action_course_hide_show_by_record() {
924
    public function test_action_course_hide_show_by_record(): void {
925
        $this->resetAfterTest(true);
925
        $this->resetAfterTest(true);
Línea 926... Línea 926...
926
 
926
 
927
        $generator = $this->getDataGenerator();
927
        $generator = $this->getDataGenerator();
928
        $category = $generator->create_category();
928
        $category = $generator->create_category();
Línea 980... Línea 980...
980
    }
980
    }
Línea 981... Línea 981...
981
 
981
 
982
    /**
982
    /**
983
     * Tests moving a course up and down by one.
983
     * Tests moving a course up and down by one.
984
     */
984
     */
985
    public function test_action_course_movedown_and_moveup() {
985
    public function test_action_course_movedown_and_moveup(): void {
Línea 986... Línea 986...
986
        global $DB;
986
        global $DB;
Línea 987... Línea 987...
987
 
987
 
Línea 1090... Línea 1090...
1090
    }
1090
    }
Línea 1091... Línea 1091...
1091
 
1091
 
1092
    /**
1092
    /**
1093
     * Tests the fetching of actions for a category.
1093
     * Tests the fetching of actions for a category.
1094
     */
1094
     */
1095
    public function test_get_category_listitem_actions() {
1095
    public function test_get_category_listitem_actions(): void {
1096
        global $PAGE;
1096
        global $PAGE;
Línea 1097... Línea 1097...
1097
        $this->resetAfterTest(true);
1097
        $this->resetAfterTest(true);
Línea 1124... Línea 1124...
1124
    }
1124
    }
Línea 1125... Línea 1125...
1125
 
1125
 
1126
    /**
1126
    /**
1127
     * Tests fetching the course actions.
1127
     * Tests fetching the course actions.
1128
     */
1128
     */
1129
    public function test_get_course_detail_actions() {
1129
    public function test_get_course_detail_actions(): void {
Línea 1130... Línea 1130...
1130
        $this->resetAfterTest(true);
1130
        $this->resetAfterTest(true);
1131
 
1131
 
1132
        $generator = $this->getDataGenerator();
1132
        $generator = $this->getDataGenerator();
Línea 1157... Línea 1157...
1157
    }
1157
    }
Línea 1158... Línea 1158...
1158
 
1158
 
1159
    /**
1159
    /**
1160
     * Test fetching course details.
1160
     * Test fetching course details.
1161
     */
1161
     */
1162
    public function test_get_course_detail_array() {
1162
    public function test_get_course_detail_array(): void {
Línea 1163... Línea 1163...
1163
        $this->resetAfterTest(true);
1163
        $this->resetAfterTest(true);
1164
 
1164
 
1165
        $generator = $this->getDataGenerator();
1165
        $generator = $this->getDataGenerator();
Línea 1192... Línea 1192...
1192
        $this->assertArrayHasKey('enrolmentmethods', $details);
1192
        $this->assertArrayHasKey('enrolmentmethods', $details);
1193
        $this->assertArrayHasKey('sections', $details);
1193
        $this->assertArrayHasKey('sections', $details);
1194
        $this->assertArrayHasKey('modulesused', $details);
1194
        $this->assertArrayHasKey('modulesused', $details);
1195
    }
1195
    }
Línea 1196... Línea 1196...
1196
 
1196
 
1197
    public function test_move_courses_into_category() {
1197
    public function test_move_courses_into_category(): void {
1198
        global $DB, $CFG;
1198
        global $DB, $CFG;
Línea 1199... Línea 1199...
1199
        $this->resetAfterTest(true);
1199
        $this->resetAfterTest(true);
1200
 
1200