Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 34... Línea 34...
34
class oauth2_test extends \advanced_testcase {
34
class oauth2_test extends \advanced_testcase {
Línea 35... Línea 35...
35
 
35
 
36
    /**
36
    /**
37
     * Tests the crud operations on oauth2 issuers.
37
     * Tests the crud operations on oauth2 issuers.
38
     */
38
     */
39
    public function test_create_and_delete_standard_issuers() {
39
    public function test_create_and_delete_standard_issuers(): void {
40
        $this->resetAfterTest();
40
        $this->resetAfterTest();
41
        $this->setAdminUser();
41
        $this->setAdminUser();
42
        api::create_standard_issuer('google');
42
        api::create_standard_issuer('google');
43
        api::create_standard_issuer('facebook');
43
        api::create_standard_issuer('facebook');
Línea 70... Línea 70...
70
    }
70
    }
Línea 71... Línea 71...
71
 
71
 
72
    /**
72
    /**
73
     * Tests the crud operations on oauth2 issuers.
73
     * Tests the crud operations on oauth2 issuers.
74
     */
74
     */
75
    public function test_create_nextcloud_without_url() {
75
    public function test_create_nextcloud_without_url(): void {
76
        $this->resetAfterTest();
76
        $this->resetAfterTest();
Línea 77... Línea 77...
77
        $this->setAdminUser();
77
        $this->setAdminUser();
78
 
78
 
79
        $this->expectException(\moodle_exception::class);
79
        $this->expectException(\moodle_exception::class);
Línea 80... Línea 80...
80
        api::create_standard_issuer('nextcloud');
80
        api::create_standard_issuer('nextcloud');
81
    }
81
    }
82
 
82
 
83
    /**
83
    /**
84
     * Tests we can list and delete each of the persistents related to an issuer.
84
     * Tests we can list and delete each of the persistents related to an issuer.
85
     */
85
     */
86
    public function test_getters() {
86
    public function test_getters(): void {
Línea 87... Línea 87...
87
        $this->resetAfterTest();
87
        $this->resetAfterTest();
Línea 144... Línea 144...
144
     *
144
     *
145
     * @dataProvider system_oauth_client_provider
145
     * @dataProvider system_oauth_client_provider
146
     * @param \stdClass $responsedata The response data to be mocked.
146
     * @param \stdClass $responsedata The response data to be mocked.
147
     * @param int $expiresin The expected expiration time.
147
     * @param int $expiresin The expected expiration time.
148
     */
148
     */
149
    public function test_get_system_oauth_client($responsedata, $expiresin) {
149
    public function test_get_system_oauth_client($responsedata, $expiresin): void {
150
        $this->resetAfterTest();
150
        $this->resetAfterTest();
151
        $this->setAdminUser();
151
        $this->setAdminUser();
Línea 152... Línea 152...
152
 
152
 
Línea 183... Línea 183...
183
    }
183
    }
Línea 184... Línea 184...
184
 
184
 
185
    /**
185
    /**
186
     * Tests we can enable and disable an issuer.
186
     * Tests we can enable and disable an issuer.
187
     */
187
     */
188
    public function test_enable_disable_issuer() {
188
    public function test_enable_disable_issuer(): void {
189
        $this->resetAfterTest();
189
        $this->resetAfterTest();
Línea 190... Línea 190...
190
        $this->setAdminUser();
190
        $this->setAdminUser();
Línea 211... Línea 211...
211
    }
211
    }
Línea 212... Línea 212...
212
 
212
 
213
    /**
213
    /**
214
     * Test the alloweddomains for an issuer.
214
     * Test the alloweddomains for an issuer.
215
     */
215
     */
216
    public function test_issuer_alloweddomains() {
216
    public function test_issuer_alloweddomains(): void {
217
        $this->resetAfterTest();
217
        $this->resetAfterTest();
Línea 218... Línea 218...
218
        $this->setAdminUser();
218
        $this->setAdminUser();
Línea 367... Línea 367...
367
    }
367
    }
Línea 368... Línea 368...
368
 
368
 
369
    /**
369
    /**
370
     * Test for get all issuers.
370
     * Test for get all issuers.
371
     */
371
     */
372
    public function test_get_all_issuers() {
372
    public function test_get_all_issuers(): void {
373
        $this->resetAfterTest();
373
        $this->resetAfterTest();
374
        $this->setAdminUser();
374
        $this->setAdminUser();
375
        $googleissuer = api::create_standard_issuer('google');
375
        $googleissuer = api::create_standard_issuer('google');
376
        api::create_standard_issuer('facebook');
376
        api::create_standard_issuer('facebook');
Línea 394... Línea 394...
394
    }
394
    }
Línea 395... Línea 395...
395
 
395
 
396
    /**
396
    /**
397
     * Test for is available for login.
397
     * Test for is available for login.
398
     */
398
     */
399
    public function test_is_available_for_login() {
399
    public function test_is_available_for_login(): void {
400
        $this->resetAfterTest();
400
        $this->resetAfterTest();
401
        $this->setAdminUser();
401
        $this->setAdminUser();
Línea 402... Línea 402...
402
        $googleissuer = api::create_standard_issuer('google');
402
        $googleissuer = api::create_standard_issuer('google');