Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 27... Línea 27...
27
 * @since      Moodle 4.2
27
 * @since      Moodle 4.2
28
 * @covers     \core_xapi\state_store
28
 * @covers     \core_xapi\state_store
29
 * @copyright  2023 Sara Arjona (sara@moodle.com)
29
 * @copyright  2023 Sara Arjona (sara@moodle.com)
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
31
 */
32
class state_store_test extends advanced_testcase {
32
final class state_store_test extends advanced_testcase {
Línea 33... Línea 33...
33
 
33
 
34
    /**
34
    /**
35
     * Setup to ensure that fixtures are loaded.
35
     * Setup to ensure that fixtures are loaded.
36
     */
36
     */
37
    public static function setUpBeforeClass(): void {
37
    public static function setUpBeforeClass(): void {
38
        global $CFG;
38
        global $CFG;
-
 
39
        require_once($CFG->dirroot.'/lib/xapi/tests/helper.php');
39
        require_once($CFG->dirroot.'/lib/xapi/tests/helper.php');
40
        parent::setUpBeforeClass();
Línea 40... Línea 41...
40
    }
41
    }
41
 
42
 
42
    /**
43
    /**
Línea 111... Línea 112...
111
    /**
112
    /**
112
     * Data provider for the test_state_store_delete and test_state_store_get tests.
113
     * Data provider for the test_state_store_delete and test_state_store_get tests.
113
     *
114
     *
114
     * @return array
115
     * @return array
115
     */
116
     */
116
    public function states_provider(): array {
117
    public static function states_provider(): array {
117
        return [
118
        return [
118
            'Existing and valid state' => [
119
            'Existing and valid state' => [
119
                'info' => [],
120
                'info' => [],
120
                'expected' => true,
121
                'expected' => true,
121
            ],
122
            ],
Línea 191... Línea 192...
191
    /**
192
    /**
192
     * Data provider for the test_state_store_put tests.
193
     * Data provider for the test_state_store_put tests.
193
     *
194
     *
194
     * @return array
195
     * @return array
195
     */
196
     */
196
    public function put_states_provider(): array {
197
    public static function put_states_provider(): array {
197
        return [
198
        return [
198
            'Update existing state' => [
199
            'Update existing state' => [
199
                'info' => [],
200
                'info' => [],
200
                'expected' => 'updated',
201
                'expected' => 'updated',
201
            ],
202
            ],
Línea 332... Línea 333...
332
    /**
333
    /**
333
     * Data provider for the test_state_store_reset and test_state_store_wipe tests.
334
     * Data provider for the test_state_store_reset and test_state_store_wipe tests.
334
     *
335
     *
335
     * @return array
336
     * @return array
336
     */
337
     */
337
    public function reset_wipe_states_provider(): array {
338
    public static function reset_wipe_states_provider(): array {
338
        return [
339
        return [
339
            'With fake_component' => [
340
            'With fake_component' => [
340
                'info' => [],
341
                'info' => [],
341
                'expected' => 4,
342
                'expected' => 4,
342
            ],
343
            ],
Línea 499... Línea 500...
499
    /**
500
    /**
500
     * Data provider for the test_get_state_ids.
501
     * Data provider for the test_get_state_ids.
501
     *
502
     *
502
     * @return array
503
     * @return array
503
     */
504
     */
504
    public function get_state_ids_provider(): array {
505
    public static function get_state_ids_provider(): array {
505
        return [
506
        return [
506
            'empty_component' => [
507
            'empty_component' => [
507
                'component' => 'empty_component',
508
                'component' => 'empty_component',
508
                'itemid' => null,
509
                'itemid' => null,
509
                'registration' => null,
510
                'registration' => null,
Línea 581... Línea 582...
581
    /**
582
    /**
582
     * Data provider for test_invalid_activityid_format.
583
     * Data provider for test_invalid_activityid_format.
583
     *
584
     *
584
     * @return array
585
     * @return array
585
     */
586
     */
586
    public function invalid_activityid_format_provider(): array {
587
    public static function invalid_activityid_format_provider(): array {
587
        return [
588
        return [
588
            'delete' => [
589
            'delete' => [
589
                'operation' => 'delete',
590
                'operation' => 'delete',
590
                'usestate' => true,
591
                'usestate' => true,
591
            ],
592
            ],