Skip to content

Commit cc3c2e2

Browse files
committed
setIsDisabled should be private
1 parent 84a3999 commit cc3c2e2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

resources/lib/UnityGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public function getIsDisabled(): bool
413413
}
414414
}
415415

416-
public function setIsDisabled(bool $new_value): void
416+
private function setIsDisabled(bool $new_value): void
417417
{
418418
$this->entry->setAttribute("isDisabled", $new_value ? "TRUE" : "FALSE");
419419
}

test/functional/PIBecomeApproveTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testReenableGroup()
9393
} finally {
9494
if ($pi_group->memberUIDExists($approve_uid)) {
9595
$pi_group->removeMemberUID($approve_uid);
96-
$pi_group->setIsDisabled(true);
96+
callPrivateMethod($pi_group, "setIsDisabled", true);
9797
assert(!$user->isPI());
9898
}
9999
}

test/functional/PIDisableTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public function testGetDisabledSetDisabled()
8585
$entry = $LDAP->getPIGroupEntry($pi_group->gid);
8686
$this->assertEquals([], $entry->getAttribute("isDisabled"));
8787
try {
88-
$pi_group->setIsDisabled(false);
88+
callPrivateMethod($pi_group, "setIsDisabled", false);
8989
$this->assertFalse($pi_group->getIsDisabled());
90-
$pi_group->setIsDisabled(true);
90+
callPrivateMethod($pi_group, "setIsDisabled", true);
9191
$this->assertTrue($pi_group->getIsDisabled());
9292
$entry->removeAttribute("isDisabled");
9393
$this->assertFalse($pi_group->getIsDisabled());
@@ -111,7 +111,7 @@ public function testPIMgmtShowsBothGroupsWithDisabledAttributeSetFalseAndUnset()
111111
http_get(__DIR__ . "/../../webroot/admin/pi-mgmt.php"),
112112
);
113113
try {
114-
$pi_group->setIsDisabled(false);
114+
callPrivateMethod($pi_group, "setIsDisabled", false);
115115
$this->assertEquals(["FALSE"], $entry->getAttribute("isDisabled"));
116116
$this->assertStringContainsString(
117117
$pi_group->gid,

0 commit comments

Comments
 (0)