| Línea 31... |
Línea 31... |
| 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 |
class rule_test extends \basic_testcase {
|
| 36 |
public function test_time_limit_access_rule() {
|
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();
|
| 41 |
$cm->id = 0;
|
41 |
$cm->id = 0;
|
| Línea 78... |
Línea 78... |
| 78 |
* @param int $timelimit Time limit of the quiz
|
78 |
* @param int $timelimit Time limit of the quiz
|
| 79 |
* @param int $displaylimit The limit that is displayed on the quiz page
|
79 |
* @param int $displaylimit The limit that is displayed on the quiz page
|
| 80 |
* @param int $actuallimit The actual limit that is being applied
|
80 |
* @param int $actuallimit The actual limit that is being applied
|
| 81 |
* @dataProvider time_limit_access_rule_with_time_close_provider
|
81 |
* @dataProvider time_limit_access_rule_with_time_close_provider
|
| 82 |
*/
|
82 |
*/
|
| 83 |
public function test_time_limit_access_rule_with_time_close($timetoclose, $timelimit, $displaylimit, $actuallimit) {
|
83 |
public function test_time_limit_access_rule_with_time_close($timetoclose, $timelimit, $displaylimit, $actuallimit): void {
|
| 84 |
$timenow = 10000;
|
84 |
$timenow = 10000;
|
| Línea 85... |
Línea 85... |
| 85 |
|
85 |
|
| 86 |
$quiz = new \stdClass();
|
86 |
$quiz = new \stdClass();
|
| 87 |
$quiz->timeclose = $timenow + $timetoclose;
|
87 |
$quiz->timeclose = $timenow + $timetoclose;
|