Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 37... Línea 37...
37
 * @covers     \core_xapi\external\get_states
37
 * @covers     \core_xapi\external\get_states
38
 * @since      Moodle 4.2
38
 * @since      Moodle 4.2
39
 * @copyright  2023 Ferran Recio <ferran@moodle.com>
39
 * @copyright  2023 Ferran Recio <ferran@moodle.com>
40
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
 */
41
 */
42
class get_states_test extends externallib_advanced_testcase {
42
final class get_states_test extends externallib_advanced_testcase {
Línea 43... Línea 43...
43
 
43
 
44
    /**
44
    /**
45
     * Setup to ensure that fixtures are loaded.
45
     * Setup to ensure that fixtures are loaded.
46
     */
46
     */
47
    public static function setUpBeforeClass(): void {
47
    public static function setUpBeforeClass(): void {
48
        global $CFG;
48
        global $CFG;
-
 
49
        require_once($CFG->dirroot . '/lib/xapi/tests/helper.php');
49
        require_once($CFG->dirroot . '/lib/xapi/tests/helper.php');
50
        parent::setUpBeforeClass();
Línea 50... Línea 51...
50
    }
51
    }
51
 
52
 
52
    /**
53
    /**
Línea 143... Línea 144...
143
    /**
144
    /**
144
     * Data provider for the test_component_names tests.
145
     * Data provider for the test_component_names tests.
145
     *
146
     *
146
     * @return  array
147
     * @return  array
147
     */
148
     */
148
    public function components_provider(): array {
149
    public static function components_provider(): array {
149
        return [
150
        return [
150
            'Inexistent component' => [
151
            'Inexistent component' => [
151
                'component' => 'inexistent_component',
152
                'component' => 'inexistent_component',
152
                'exception' => true,
153
                'exception' => true,
153
            ],
154
            ],
Línea 187... Línea 188...
187
    /**
188
    /**
188
     * Data provider for the test_since_formats tests.
189
     * Data provider for the test_since_formats tests.
189
     *
190
     *
190
     * @return  array
191
     * @return  array
191
     */
192
     */
192
    public function since_formats_provider(): array {
193
    public static function since_formats_provider(): array {
193
        return [
194
        return [
194
            'Null date' => [
195
            'Null date' => [
195
                'since' => null,
196
                'since' => null,
196
                'expected' => ['aa', 'bb', 'cc', 'dd'],
197
                'expected' => ['aa', 'bb', 'cc', 'dd'],
197
                'exception' => false,
198
                'exception' => false,
Línea 240... Línea 241...
240
    /**
241
    /**
241
     * Data provider for the test_activity_iri tests.
242
     * Data provider for the test_activity_iri tests.
242
     *
243
     *
243
     * @return  array
244
     * @return  array
244
     */
245
     */
245
    public function activity_iri_provider(): array {
246
    public static function activity_iri_provider(): array {
246
        return [
247
        return [
247
            'Activity with several states' => [
248
            'Activity with several states' => [
248
                'activityiri' => iri::generate('1', 'activity'),
249
                'activityiri' => iri::generate('1', 'activity'),
249
                'expected' => ['aa', 'bb', 'cc', 'dd'],
250
                'expected' => ['aa', 'bb', 'cc', 'dd'],
250
            ],
251
            ],
Línea 292... Línea 293...
292
    /**
293
    /**
293
     * Data provider for the test_agent_values tests.
294
     * Data provider for the test_agent_values tests.
294
     *
295
     *
295
     * @return  array
296
     * @return  array
296
     */
297
     */
297
    public function agent_values_provider(): array {
298
    public static function agent_values_provider(): array {
298
        return [
299
        return [
299
            'Current user' => [
300
            'Current user' => [
300
                'agentreference' => 'current',
301
                'agentreference' => 'current',
301
                'expected' => ['aa', 'bb', 'cc', 'dd'],
302
                'expected' => ['aa', 'bb', 'cc', 'dd'],
302
                'exception' => false,
303
                'exception' => false,
Línea 330... Línea 331...
330
    /**
331
    /**
331
     * Data provider for the test_registration_values tests.
332
     * Data provider for the test_registration_values tests.
332
     *
333
     *
333
     * @return  array
334
     * @return  array
334
     */
335
     */
335
    public function registration_values_provider(): array {
336
    public static function registration_values_provider(): array {
336
        return [
337
        return [
337
            'Null registration' => [
338
            'Null registration' => [
338
                'registration' => null,
339
                'registration' => null,
339
                'expected' => ['aa', 'bb', 'cc', 'dd'],
340
                'expected' => ['aa', 'bb', 'cc', 'dd'],
340
            ],
341
            ],