Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 52... Línea 52...
52
    }
52
    }
Línea 53... Línea 53...
53
 
53
 
54
    /**
54
    /**
55
     * Test the update user profile image function.
55
     * Test the update user profile image function.
56
     */
56
     */
57
    public function test_update_user_profile_image() {
57
    public function test_update_user_profile_image(): void {
Línea 58... Línea 58...
58
        global $DB, $CFG;
58
        global $DB, $CFG;
59
 
59
 
Línea 77... Línea 77...
77
    }
77
    }
Línea 78... Línea 78...
78
 
78
 
79
    /**
79
    /**
80
     * Test that we can not enrol past the maximum number of users allowed.
80
     * Test that we can not enrol past the maximum number of users allowed.
81
     */
81
     */
82
    public function test_enrol_user_max_enrolled() {
82
    public function test_enrol_user_max_enrolled(): void {
Línea 83... Línea 83...
83
        global $DB;
83
        global $DB;
84
 
84
 
85
        // Set up the LTI enrolment tool.
85
        // Set up the LTI enrolment tool.
Línea 106... Línea 106...
106
    }
106
    }
Línea 107... Línea 107...
107
 
107
 
108
    /**
108
    /**
109
     * Test that we can not enrol when the enrolment has not started.
109
     * Test that we can not enrol when the enrolment has not started.
110
     */
110
     */
111
    public function test_enrol_user_enrolment_not_started() {
111
    public function test_enrol_user_enrolment_not_started(): void {
Línea 112... Línea 112...
112
        global $DB;
112
        global $DB;
113
 
113
 
114
        // Set up the LTI enrolment tool.
114
        // Set up the LTI enrolment tool.
Línea 128... Línea 128...
128
    }
128
    }
Línea 129... Línea 129...
129
 
129
 
130
    /**
130
    /**
131
     * Test that we can not enrol when the enrolment has finished.
131
     * Test that we can not enrol when the enrolment has finished.
132
     */
132
     */
133
    public function test_enrol_user_enrolment_finished() {
133
    public function test_enrol_user_enrolment_finished(): void {
Línea 134... Línea 134...
134
        global $DB;
134
        global $DB;
135
 
135
 
136
        // Set up the LTI enrolment tool.
136
        // Set up the LTI enrolment tool.
Línea 150... Línea 150...
150
    }
150
    }
Línea 151... Línea 151...
151
 
151
 
152
    /**
152
    /**
153
     * Test returning the number of available tools.
153
     * Test returning the number of available tools.
154
     */
154
     */
155
    public function test_count_lti_tools() {
155
    public function test_count_lti_tools(): void {
156
        $generator = $this->getDataGenerator();
156
        $generator = $this->getDataGenerator();
157
        // Create two tools belonging to the same course.
157
        // Create two tools belonging to the same course.
158
        $course1 = $generator->create_course();
158
        $course1 = $generator->create_course();
159
        $data = new \stdClass();
159
        $data = new \stdClass();
Línea 189... Línea 189...
189
    }
189
    }
Línea 190... Línea 190...
190
 
190
 
191
    /**
191
    /**
192
     * Test returning the list of available tools.
192
     * Test returning the list of available tools.
193
     */
193
     */
194
    public function test_get_lti_tools() {
194
    public function test_get_lti_tools(): void {
195
        $generator = $this->getDataGenerator();
195
        $generator = $this->getDataGenerator();
196
        // Create two tools belonging to the same course.
196
        // Create two tools belonging to the same course.
197
        $course1 = $generator->create_course();
197
        $course1 = $generator->create_course();
198
        $data = new \stdClass();
198
        $data = new \stdClass();
Línea 242... Línea 242...
242
    }
242
    }
Línea 243... Línea 243...
243
 
243
 
244
    /**
244
    /**
245
     * Test getting the launch url of a tool.
245
     * Test getting the launch url of a tool.
246
     */
246
     */
247
    public function test_get_launch_url() {
247
    public function test_get_launch_url(): void {
248
        $course1 = $this->getDataGenerator()->create_course();
248
        $course1 = $this->getDataGenerator()->create_course();
249
        $data = new \stdClass();
249
        $data = new \stdClass();
250
        $data->courseid = $course1->id;
250
        $data->courseid = $course1->id;
Línea 256... Línea 256...
256
    }
256
    }
Línea 257... Línea 257...
257
 
257
 
258
    /**
258
    /**
259
     * Test getting the cartridge url of a tool.
259
     * Test getting the cartridge url of a tool.
260
     */
260
     */
261
    public function test_get_cartridge_url() {
261
    public function test_get_cartridge_url(): void {
Línea 262... Línea 262...
262
        global $CFG;
262
        global $CFG;
Línea 263... Línea 263...
263
 
263
 
Línea 286... Línea 286...
286
    }
286
    }
Línea 287... Línea 287...
287
 
287
 
288
    /**
288
    /**
289
     * Test getting the cartridge url of a tool.
289
     * Test getting the cartridge url of a tool.
290
     */
290
     */
291
    public function test_get_proxy_url() {
291
    public function test_get_proxy_url(): void {
Línea 292... Línea 292...
292
        global $CFG;
292
        global $CFG;
Línea 293... Línea 293...
293
 
293
 
Línea 316... Línea 316...
316
    }
316
    }
Línea 317... Línea 317...
317
 
317
 
318
    /**
318
    /**
319
     * Test getting the name of a tool.
319
     * Test getting the name of a tool.
320
     */
320
     */
321
    public function test_get_name() {
321
    public function test_get_name(): void {
322
        $course1 = $this->getDataGenerator()->create_course();
322
        $course1 = $this->getDataGenerator()->create_course();
323
        $data = new \stdClass();
323
        $data = new \stdClass();
324
        $data->courseid = $course1->id;
324
        $data->courseid = $course1->id;
Línea 333... Línea 333...
333
    }
333
    }
Línea 334... Línea 334...
334
 
334
 
335
    /**
335
    /**
336
     * Test getting the description of a tool.
336
     * Test getting the description of a tool.
337
     */
337
     */
338
    public function test_get_description() {
338
    public function test_get_description(): void {
339
        $generator = $this->getDataGenerator();
339
        $generator = $this->getDataGenerator();
340
        $course1 = $generator->create_course();
340
        $course1 = $generator->create_course();
341
        $data = new \stdClass();
341
        $data = new \stdClass();
342
        $data->courseid = $course1->id;
342
        $data->courseid = $course1->id;
Línea 356... Línea 356...
356
    }
356
    }
Línea 357... Línea 357...
357
 
357
 
358
    /**
358
    /**
359
     * Test getting the icon of a tool.
359
     * Test getting the icon of a tool.
360
     */
360
     */
361
    public function test_get_icon() {
361
    public function test_get_icon(): void {
Línea 362... Línea 362...
362
        global $CFG;
362
        global $CFG;
363
 
363
 
364
        $course1 = $this->getDataGenerator()->create_course();
364
        $course1 = $this->getDataGenerator()->create_course();
Línea 374... Línea 374...
374
    }
374
    }
Línea 375... Línea 375...
375
 
375
 
376
    /**
376
    /**
377
     * Test verifying a cartridge token.
377
     * Test verifying a cartridge token.
378
     */
378
     */
379
    public function test_verify_cartridge_token() {
379
    public function test_verify_cartridge_token(): void {
380
        $course1 = $this->getDataGenerator()->create_course();
380
        $course1 = $this->getDataGenerator()->create_course();
381
        $data = new \stdClass();
381
        $data = new \stdClass();
382
        $data->courseid = $course1->id;
382
        $data->courseid = $course1->id;
Línea 388... Línea 388...
388
    }
388
    }
Línea 389... Línea 389...
389
 
389
 
390
    /**
390
    /**
391
     * Test verifying a proxy token.
391
     * Test verifying a proxy token.
392
     */
392
     */
393
    public function test_verify_proxy_token() {
393
    public function test_verify_proxy_token(): void {
394
        $course1 = $this->getDataGenerator()->create_course();
394
        $course1 = $this->getDataGenerator()->create_course();
395
        $data = new \stdClass();
395
        $data = new \stdClass();
396
        $data->courseid = $course1->id;
396
        $data->courseid = $course1->id;
Línea 472... Línea 472...
472
     * Test set_xpath.
472
     * Test set_xpath.
473
     * @dataProvider set_xpath_provider
473
     * @dataProvider set_xpath_provider
474
     * @param array $parameters A hash of parameters represented by a heirarchy of xpath expressions
474
     * @param array $parameters A hash of parameters represented by a heirarchy of xpath expressions
475
     * @param string $expected The name of the fixture file containing the expected result.
475
     * @param string $expected The name of the fixture file containing the expected result.
476
     */
476
     */
477
    public function test_set_xpath($parameters, $expected) {
477
    public function test_set_xpath($parameters, $expected): void {
478
        $helper = new \ReflectionClass('enrol_lti\\helper');
478
        $helper = new \ReflectionClass('enrol_lti\\helper');
479
        $function = $helper->getMethod('set_xpath');
479
        $function = $helper->getMethod('set_xpath');
Línea 480... Línea 480...
480
 
480
 
481
        $document = new \DOMDocument();
481
        $document = new \DOMDocument();
Línea 488... Línea 488...
488
    }
488
    }
Línea 489... Línea 489...
489
 
489
 
490
    /**
490
    /**
491
     * Test set_xpath when an incorrect xpath expression is given.
491
     * Test set_xpath when an incorrect xpath expression is given.
492
     */
492
     */
493
    public function test_set_xpath_incorrect_xpath() {
493
    public function test_set_xpath_incorrect_xpath(): void {
494
        $parameters = [
494
        $parameters = [
495
            "/root" => [
495
            "/root" => [
496
                "/firstnode" => null,
496
                "/firstnode" => null,
497
                "/parentnode*&#^*#(" => [
497
                "/parentnode*&#^*#(" => [
Línea 511... Línea 511...
511
    }
511
    }
Línea 512... Línea 512...
512
 
512
 
513
    /**
513
    /**
514
     * Test create cartridge.
514
     * Test create cartridge.
515
     */
515
     */
516
    public function test_create_cartridge() {
516
    public function test_create_cartridge(): void {
Línea 517... Línea 517...
517
        global $CFG;
517
        global $CFG;
518
 
518
 
519
        $course1 = $this->getDataGenerator()->create_course();
519
        $course1 = $this->getDataGenerator()->create_course();