diff options
author | Valentin Popov <info@valentineus.link> | 2018-06-07 05:04:53 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2018-06-07 05:04:53 +0300 |
commit | 94ff9d806f7962f26634a42686fad9ffeb7103e1 (patch) | |
tree | 1f21a767cd69c8f36538bc4bb6b4149f1f1958e6 | |
parent | 6b3130d1d5cb56b7345dc3fd61756defbc021c39 (diff) | |
download | tool_apisiteadmins-94ff9d806f7962f26634a42686fad9ffeb7103e1.tar.xz tool_apisiteadmins-94ff9d806f7962f26634a42686fad9ffeb7103e1.zip |
New test
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r-- | tests/api_test.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/api_test.php b/tests/api_test.php index d7b9f4b..c435e71 100644 --- a/tests/api_test.php +++ b/tests/api_test.php @@ -94,6 +94,23 @@ class tool_apisiteadmins_api_testcase extends advanced_testcase { /** * @depends test_adding_and_deleting_administrator */ + public function test_deleting_all_administrators() { + global $CFG; + + $this->resetAfterTest(true); + + $this->assertCount(1, get_admins()); + $user = get_admin(); + + /* Removes a single administrator */ + tool_apisiteadmins::remove_user($user->id); + $this->assertCount(1, get_admins()); + $this->assertEquals($user, get_admin()); + } + + /** + * @depends test_adding_and_deleting_administrator + */ public function test_exception_adding_check() { global $CFG; |