aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/api_test.php17
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;