Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 46... Línea 46...
46
class lib_test extends \advanced_testcase {
46
class lib_test extends \advanced_testcase {
Línea 47... Línea 47...
47
 
47
 
48
    /**
48
    /**
49
     * Test can_output_item.
49
     * Test can_output_item.
50
     */
50
     */
51
    public function test_can_output_item() {
51
    public function test_can_output_item(): void {
Línea 52... Línea 52...
52
        $this->resetAfterTest();
52
        $this->resetAfterTest();
Línea 53... Línea 53...
53
 
53
 
Línea 180... Línea 180...
180
    /**
180
    /**
181
     * Tests that ungraded_counts calculates count and sum of grades correctly when there are graded users.
181
     * Tests that ungraded_counts calculates count and sum of grades correctly when there are graded users.
182
     *
182
     *
183
     * @covers \grade_report::ungraded_counts
183
     * @covers \grade_report::ungraded_counts
184
     */
184
     */
185
    public function test_ungraded_counts_count_sumgrades() {
185
    public function test_ungraded_counts_count_sumgrades(): void {
186
        global $DB;
186
        global $DB;
Línea 187... Línea 187...
187
 
187
 
Línea 188... Línea 188...
188
        $this->resetAfterTest(true);
188
        $this->resetAfterTest(true);
Línea 375... Línea 375...
375
     * @param array $expectedcount expected count value (i.e. number of ugraded grades)
375
     * @param array $expectedcount expected count value (i.e. number of ugraded grades)
376
     * @param array $expectedsumarray expceted sum of grades
376
     * @param array $expectedsumarray expceted sum of grades
377
     *
377
     *
378
     * @covers \grade_report::ungraded_counts
378
     * @covers \grade_report::ungraded_counts
379
     */
379
     */
380
    public function test_ungraded_counts_hidden_grades(bool $hidden, array $expectedcount, array $expectedsumarray) {
380
    public function test_ungraded_counts_hidden_grades(bool $hidden, array $expectedcount, array $expectedsumarray): void {
381
        $this->resetAfterTest();
381
        $this->resetAfterTest();
Línea 382... Línea 382...
382
 
382
 
Línea 383... Línea 383...
383
        $course = $this->getDataGenerator()->create_course();
383
        $course = $this->getDataGenerator()->create_course();
Línea 475... Línea 475...
475
    /**
475
    /**
476
     * Tests that ungraded_counts calculates count and sum of grades correctly for groups when there are graded users.
476
     * Tests that ungraded_counts calculates count and sum of grades correctly for groups when there are graded users.
477
     *
477
     *
478
     * @covers \grade_report::ungraded_counts
478
     * @covers \grade_report::ungraded_counts
479
     */
479
     */
480
    public function test_ungraded_count_sumgrades_groups() {
480
    public function test_ungraded_count_sumgrades_groups(): void {
481
        global $DB;
481
        global $DB;
Línea 482... Línea 482...
482
 
482
 
Línea 483... Línea 483...
483
        $this->resetAfterTest();
483
        $this->resetAfterTest();
Línea 638... Línea 638...
638
     * @param array $expectedsumarray expected sum of grades
638
     * @param array $expectedsumarray expected sum of grades
639
     *
639
     *
640
     * @covers \grade_report::ungraded_counts
640
     * @covers \grade_report::ungraded_counts
641
     */
641
     */
642
    public function test_ungraded_counts_only_active_enrol(bool $onlyactive,
642
    public function test_ungraded_counts_only_active_enrol(bool $onlyactive,
643
            int $hascapability, ?bool $showonlyactiveenrolpref, array $expectedcount, array $expectedsumarray) {
643
            int $hascapability, ?bool $showonlyactiveenrolpref, array $expectedcount, array $expectedsumarray): void {
644
        global $CFG, $DB;
644
        global $CFG, $DB;
Línea 645... Línea 645...
645
 
645
 
Línea 646... Línea 646...
646
        $this->resetAfterTest();
646
        $this->resetAfterTest();
Línea 791... Línea 791...
791
     * @param array $expectedmeancount expected meancount value
791
     * @param array $expectedmeancount expected meancount value
792
     * @param array $expectedaverage expceted average value
792
     * @param array $expectedaverage expceted average value
793
     *
793
     *
794
     * @covers \grade_report::calculate_average
794
     * @covers \grade_report::calculate_average
795
     */
795
     */
796
    public function test_calculate_average(int $meanselection, array $expectedmeancount, array $expectedaverage) {
796
    public function test_calculate_average(int $meanselection, array $expectedmeancount, array $expectedaverage): void {
797
        global $DB;
797
        global $DB;
Línea 798... Línea 798...
798
 
798
 
Línea 799... Línea 799...
799
        $this->resetAfterTest(true);
799
        $this->resetAfterTest(true);
Línea 900... Línea 900...
900
    /**
900
    /**
901
     * Tests for item types.
901
     * Tests for item types.
902
     *
902
     *
903
     * @covers \grade_report::item_types
903
     * @covers \grade_report::item_types
904
     */
904
     */
905
    public function test_item_types() {
905
    public function test_item_types(): void {
906
        $this->resetAfterTest(true);
906
        $this->resetAfterTest(true);
Línea 907... Línea 907...
907
 
907
 
908
        $course1 = $this->getDataGenerator()->create_course();
908
        $course1 = $this->getDataGenerator()->create_course();
Línea 974... Línea 974...
974
    /**
974
    /**
975
     * Test get_gradable_users() function.
975
     * Test get_gradable_users() function.
976
     *
976
     *
977
     * @covers ::get_gradable_users
977
     * @covers ::get_gradable_users
978
     */
978
     */
979
    public function test_get_gradable_users() {
979
    public function test_get_gradable_users(): void {
980
        global $DB;
980
        global $DB;
Línea 981... Línea 981...
981
 
981
 
982
        $this->setAdminUser();
982
        $this->setAdminUser();