Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 46... Línea 46...
46
 * @package    core_xapi
46
 * @package    core_xapi
47
 * @since      Moodle 3.9
47
 * @since      Moodle 3.9
48
 * @copyright  2020 Ferran Recio
48
 * @copyright  2020 Ferran Recio
49
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
49
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
50
 */
50
 */
51
class post_statement_test extends externallib_advanced_testcase {
51
final class post_statement_test extends externallib_advanced_testcase {
Línea 52... Línea 52...
52
 
52
 
53
    /** @var test_helper for generating valid xapi statements. */
53
    /** @var test_helper for generating valid xapi statements. */
Línea 54... Línea 54...
54
    private $testhelper;
54
    private $testhelper;
Línea 64... Línea 64...
64
    /**
64
    /**
65
     * Setup test.
65
     * Setup test.
66
     */
66
     */
67
    public function setUp(): void {
67
    public function setUp(): void {
68
        global $CFG;
68
        global $CFG;
-
 
69
        parent::setUp();
69
        // We disable group actors on the test xapi_handler.
70
        // We disable group actors on the test xapi_handler.
70
        $CFG->xapitestforcegroupactors = false;
71
        $CFG->xapitestforcegroupactors = false;
71
    }
72
    }
Línea 72... Línea 73...
72
 
73
 
Línea 185... Línea 186...
185
    /**
186
    /**
186
     * Data provider for the test_component_names tests.
187
     * Data provider for the test_component_names tests.
187
     *
188
     *
188
     * @return  array
189
     * @return  array
189
     */
190
     */
190
    public function components_provider(): array {
191
    public static function components_provider(): array {
191
        return [
192
        return [
192
            'Inexistent component' => [
193
            'Inexistent component' => [
193
                'inexistent_component', []
194
                'inexistent_component', []
194
            ],
195
            ],
195
            'Compatible component' => [
196
            'Compatible component' => [
Línea 231... Línea 232...
231
    /**
232
    /**
232
     * Data provider for the test_components tests.
233
     * Data provider for the test_components tests.
233
     *
234
     *
234
     * @return  array
235
     * @return  array
235
     */
236
     */
236
    public function invalid_json_provider(): array {
237
    public static function invalid_json_provider(): array {
237
        return [
238
        return [
238
            'Wrong json' => [
239
            'Wrong json' => [
239
                'This is not { a json object /'
240
                'This is not { a json object /'
240
            ],
241
            ],
241
            'Empty string json' => [
242
            'Empty string json' => [
Línea 374... Línea 375...
374
    /**
375
    /**
375
     * Data provider for the test_components tests.
376
     * Data provider for the test_components tests.
376
     *
377
     *
377
     * @return  array
378
     * @return  array
378
     */
379
     */
379
    public function statement_provider(): array {
380
    public static function statement_provider(): array {
380
        return [
381
        return [
381
            // Single statement with group statements enabled.
382
            // Single statement with group statements enabled.
382
            'Single, Valid actor, valid verb' => [
383
            'Single, Valid actor, valid verb' => [
383
                false, true, true, [true]
384
                false, true, true, [true]
384
            ],
385
            ],
Línea 447... Línea 448...
447
    /**
448
    /**
448
     * Data provider for the test_components tests.
449
     * Data provider for the test_components tests.
449
     *
450
     *
450
     * @return  array
451
     * @return  array
451
     */
452
     */
452
    public function group_statement_provider(): array {
453
    public static function group_statement_provider(): array {
453
        return [
454
        return [
454
            // Single statement with group statements enabled.
455
            // Single statement with group statements enabled.
455
            'Group statement + group statement without group support' => [
456
            'Group statement + group statement without group support' => [
456
                true, true, []
457
                true, true, []
457
            ],
458
            ],