MDL-67271 core: Add test to find missing SVG icons
[moodle.git] / lib / tests / fixtures / task_fixtures.php
blobefaaa98b54b97de2d573d1e6c500d05c4dbc8463
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.
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/>.
17 /**
18 * Fixtures for task tests.
20 * @package core
21 * @category phpunit
22 * @copyright 2014 Petr Skoda
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 namespace core\task;
27 defined('MOODLE_INTERNAL') || die();
29 /**
30 * Test class.
32 * @copyright 2022 Catalyst IT Australia Pty Ltd
33 * @author Cameron Ball <cameron@cameron1729.xyz>
34 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 class adhoc_test_task extends \core\task\adhoc_task {
38 /**
39 * Constructor.
41 * @param int|null $nextruntime Next run time
42 * @param int|null $timestarted Time started
44 public function __construct(?int $nextruntime = null, ?int $timestarted = null) {
45 if ($nextruntime) {
46 $this->set_next_run_time($nextruntime);
49 if ($timestarted) {
50 $this->set_timestarted($timestarted);
54 /**
55 * Get task name
57 * @return string
59 public function get_name() {
60 return 'Test adhoc class';
63 /**
64 * Execute.
66 public function execute() {
70 /**
71 * Test class.
73 * @copyright 2022 Catalyst IT Australia Pty Ltd
74 * @author Cameron Ball <cameron@cameron1729.xyz>
75 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
77 class adhoc_test2_task extends adhoc_test_task {
80 /**
81 * Test class.
83 * @copyright 2022 Catalyst IT Australia Pty Ltd
84 * @author Cameron Ball <cameron@cameron1729.xyz>
85 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
87 class adhoc_test3_task extends adhoc_test_task {
90 /**
91 * Test class.
93 * @copyright 2022 Catalyst IT Australia Pty Ltd
94 * @author Cameron Ball <cameron@cameron1729.xyz>
95 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
97 class adhoc_test4_task extends adhoc_test_task {
101 * Test class.
103 * @copyright 2022 Catalyst IT Australia Pty Ltd
104 * @author Cameron Ball <cameron@cameron1729.xyz>
105 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
107 class adhoc_test5_task extends adhoc_test_task {
110 class scheduled_test_task extends \core\task\scheduled_task {
111 public function get_name() {
112 return "Test task";
115 public function execute() {
119 class scheduled_test2_task extends \core\task\scheduled_task {
120 public function get_name() {
121 return "Test task 2";
124 public function execute() {
128 class scheduled_test3_task extends \core\task\scheduled_task {
129 public function get_name() {
130 return "Test task 3";
133 public function execute() {
137 namespace mod_fake\task;
139 class adhoc_component_task extends \core\task\adhoc_task {
140 public function execute() {