Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 23... Línea 23...
23
 * @author      Peter Burnett <peterburnett@catalyst-au.net>
23
 * @author      Peter Burnett <peterburnett@catalyst-au.net>
24
 * @author      Kevin Pham <kevinpham@catalyst-au.net>
24
 * @author      Kevin Pham <kevinpham@catalyst-au.net>
25
 * @copyright   Catalyst IT
25
 * @copyright   Catalyst IT
26
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27
 */
27
 */
28
class factor_test extends \advanced_testcase {
28
final class factor_test extends \advanced_testcase {
Línea 29... Línea 29...
29
 
29
 
30
    /**
30
    /**
31
     * Holds specific requested factor, which is token factor.
31
     * Holds specific requested factor, which is token factor.
32
     *
32
     *
33
     * @var \factor_token\factor $factor
33
     * @var \factor_token\factor $factor
34
     */
34
     */
Línea 35... Línea 35...
35
    public \factor_token\factor $factor;
35
    public \factor_token\factor $factor;
-
 
36
 
36
 
37
    public function setUp(): void {
37
    public function setUp(): void {
38
        parent::setUp();
38
        $this->resetAfterTest();
39
        $this->resetAfterTest();
Línea 39... Línea 40...
39
        $this->factor = new \factor_token\factor('token');
40
        $this->factor = new \factor_token\factor('token');
Línea 273... Línea 274...
273
    /**
274
    /**
274
     * Timestamps for a 24 hour period starting from a fixed time.
275
     * Timestamps for a 24 hour period starting from a fixed time.
275
     * Increments by 30 minutes to cover half hour and hour cases.
276
     * Increments by 30 minutes to cover half hour and hour cases.
276
     * Starting timestamp: 2022-01-15 07:30:00 Australia/Melbourne time.
277
     * Starting timestamp: 2022-01-15 07:30:00 Australia/Melbourne time.
277
     */
278
     */
278
    public function timestamp_provider() {
279
    public static function timestamp_provider(): array {
279
        $starttimestamp = 1642192200;
280
        $starttimestamp = 1642192200;
280
        foreach (range(0, 23) as $i) {
281
        foreach (range(0, 23) as $i) {
281
            $timestamps[] = [$starttimestamp + ($i * HOURSECS)];
282
            $timestamps[] = [$starttimestamp + ($i * HOURSECS)];
282
            $timestamps[] = [$starttimestamp + ($i * HOURSECS) + (30 * MINSECS)];
283
            $timestamps[] = [$starttimestamp + ($i * HOURSECS) + (30 * MINSECS)];
283
        }
284
        }