1441 |
ariadna |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
namespace core\tests;
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* TODO describe file courses_tasks_testcase
|
|
|
21 |
*
|
|
|
22 |
* @package core
|
|
|
23 |
* @copyright 2024 Andrew Lyons <andrew@nicols.co.uk>
|
|
|
24 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
25 |
*/
|
|
|
26 |
abstract class courses_tasks_testcase extends \advanced_testcase {
|
|
|
27 |
/**
|
|
|
28 |
* Data provider for test_show_started_courses.
|
|
|
29 |
*
|
|
|
30 |
* @return array
|
|
|
31 |
*/
|
|
|
32 |
public static function get_courses_provider(): array {
|
|
|
33 |
return [
|
|
|
34 |
'No hidden courses' => [
|
|
|
35 |
'lastweekcount' => 0,
|
|
|
36 |
'yesterdaycount' => 0,
|
|
|
37 |
'tomorrowcount' => 0,
|
|
|
38 |
],
|
|
|
39 |
'No hidden courses (without visible courses)' => [
|
|
|
40 |
'lastweekcount' => 0,
|
|
|
41 |
'yesterdaycount' => 0,
|
|
|
42 |
'tomorrowcount' => 0,
|
|
|
43 |
'createvisible' => false,
|
|
|
44 |
],
|
|
|
45 |
'Hidden courses with last week or tomorrow dates' => [
|
|
|
46 |
'lastweekcount' => 2,
|
|
|
47 |
'yesterdaycount' => 0,
|
|
|
48 |
'tomorrowcount' => 2,
|
|
|
49 |
],
|
|
|
50 |
'One hidden course of each type (last week, yesterday and tomorrow)' => [
|
|
|
51 |
'lastweekcount' => 1,
|
|
|
52 |
'yesterdaycount' => 1,
|
|
|
53 |
'tomorrowcount' => 1,
|
|
|
54 |
],
|
|
|
55 |
'Different hidden courses of each type' => [
|
|
|
56 |
'lastweekcount' => 2,
|
|
|
57 |
'yesterdaycount' => 3,
|
|
|
58 |
'tomorrowcount' => 4,
|
|
|
59 |
],
|
|
|
60 |
'A couple of hidden courses of each type (without visible courses)' => [
|
|
|
61 |
'lastweekcount' => 2,
|
|
|
62 |
'yesterdaycount' => 2,
|
|
|
63 |
'tomorrowcount' => 2,
|
|
|
64 |
'createvisible' => false,
|
|
|
65 |
],
|
|
|
66 |
'Only a few hidden courses for yesterdaycount' => [
|
|
|
67 |
'lastweekcount' => 0,
|
|
|
68 |
'yesterdaycount' => 5,
|
|
|
69 |
'tomorrowcount' => 0,
|
|
|
70 |
],
|
|
|
71 |
'Only a few hidden courses for yesterday (without visible courses)' => [
|
|
|
72 |
'lastweekcount' => 0,
|
|
|
73 |
'yesterdaycount' => 5,
|
|
|
74 |
'tomorrowcount' => 0,
|
|
|
75 |
'createvisible' => false,
|
|
|
76 |
],
|
|
|
77 |
];
|
|
|
78 |
}
|
|
|
79 |
}
|