| Línea 30... |
Línea 30... |
| 30 |
*
|
30 |
*
|
| 31 |
* @package quizaccess_timelimit
|
31 |
* @package quizaccess_timelimit
|
| 32 |
* @copyright 2008 The Open University
|
32 |
* @copyright 2008 The Open University
|
| 33 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
33 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 34 |
*/
|
34 |
*/
|
| 35 |
class rule_test extends \basic_testcase {
|
35 |
final class rule_test extends \basic_testcase {
|
| 36 |
public function test_time_limit_access_rule(): void {
|
36 |
public function test_time_limit_access_rule(): void {
|
| 37 |
$quiz = new \stdClass();
|
37 |
$quiz = new \stdClass();
|
| 38 |
$quiz->timeclose = 0;
|
38 |
$quiz->timeclose = 0;
|
| 39 |
$quiz->timelimit = 3600;
|
39 |
$quiz->timelimit = 3600;
|
| 40 |
$cm = new \stdClass();
|
40 |
$cm = new \stdClass();
|
| Línea 61... |
Línea 61... |
| 61 |
/**
|
61 |
/**
|
| 62 |
* Data provider for test_time_limit_access_rule_with_time_close.
|
62 |
* Data provider for test_time_limit_access_rule_with_time_close.
|
| 63 |
*
|
63 |
*
|
| 64 |
* @return array of ($timetoclose, $timelimit, $displaylimit, $actuallimit)
|
64 |
* @return array of ($timetoclose, $timelimit, $displaylimit, $actuallimit)
|
| 65 |
*/
|
65 |
*/
|
| 66 |
public function time_limit_access_rule_with_time_close_provider() {
|
66 |
public static function time_limit_access_rule_with_time_close_provider(): array {
|
| 67 |
return [
|
67 |
return [
|
| 68 |
'Close time is earlier than time limit' => [1800, 3600, 3600, 1800],
|
68 |
'Close time is earlier than time limit' => [1800, 3600, 3600, 1800],
|
| 69 |
'Close time is on time limit' => [3600, 3600, 3600, 3600],
|
69 |
'Close time is on time limit' => [3600, 3600, 3600, 3600],
|
| 70 |
'Close time is later than time limit' => [3600, 1800, 1800, 1800]
|
70 |
'Close time is later than time limit' => [3600, 1800, 1800, 1800]
|
| 71 |
];
|
71 |
];
|