Skip to content

Commit

Permalink
MDL-70725 oauth2: move expectException to separate method
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Jan 27, 2021
1 parent fd840ab commit 9975f5e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/tests/oauth2_test.php
Expand Up @@ -44,9 +44,6 @@ public function test_create_and_delete_standard_issuers() {
\core\oauth2\api::create_standard_issuer('microsoft');
\core\oauth2\api::create_standard_issuer('nextcloud', 'https://dummy.local/nextcloud/');

$this->expectException(\moodle_exception::class);
\core\oauth2\api::create_standard_issuer('nextcloud');

$issuers = \core\oauth2\api::get_all_issuers();

$this->assertEquals($issuers[0]->get('name'), 'Google');
Expand All @@ -72,6 +69,17 @@ public function test_create_and_delete_standard_issuers() {
$this->assertEquals($issuers[2]->get('name'), 'Nextcloud');
}

/**
* Tests the crud operations on oauth2 issuers.
*/
public function test_create_nextcloud_without_url() {
$this->resetAfterTest();
$this->setAdminUser();

$this->expectException(\moodle_exception::class);
\core\oauth2\api::create_standard_issuer('nextcloud');
}

/**
* Tests we can list and delete each of the persistents related to an issuer.
*/
Expand Down

0 comments on commit 9975f5e

Please sign in to comment.