Skip to content

Commit bde4033

Browse files
authored
simplify test functions (#380)
1 parent f253caa commit bde4033

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

test/functional/AccountDeletionRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private function getNumberAccountDeletionRequests()
3232
public function testRequestAccountDeletionUserHasNoGroups()
3333
{
3434
global $USER, $SQL;
35-
switchUser(...getUserHasNotRequestedAccountDeletionHasNoGroups());
35+
switchUser(...getBlankUser());
3636
$this->assertEmpty($USER->getPIGroupGIDs());
3737
$this->assertNumberAccountDeletionRequests(0);
3838
try {

test/functional/PIMemberRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testRequestMembership()
3535
$this->assertTrue($pi_group->exists());
3636
$this->assertEqualsCanonicalizing([$pi], $pi_group->getGroupMembers());
3737
$this->assertEqualsCanonicalizing([], $SQL->getRequests($gid));
38-
switchUser(...getUserNotPiNotRequestedBecomePi());
38+
switchUser(...getBlankUser());
3939
$uid = $USER->uid;
4040
$this->assertFalse($USER->isPI());
4141
$this->assertFalse($SQL->requestExists($uid, UnitySQL::REQUEST_BECOME_PI));

test/functional/PiBecomeRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private function getNumberPiBecomeRequests()
3535
public function testRequestBecomePi()
3636
{
3737
global $USER, $SQL;
38-
switchUser(...getUserNotPiNotRequestedBecomePi());
38+
switchUser(...getBlankUser());
3939
$this->assertFalse($USER->isPI());
4040
$this->assertNumberPiBecomeRequests(0);
4141
try {

test/phpunit-bootstrap.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ function getUserHasNotRequestedAccountDeletionHasGroup()
239239
return ["[email protected]", "foo", "bar", "[email protected]"];
240240
}
241241

242-
function getUserHasNotRequestedAccountDeletionHasNoGroups()
242+
/* a blank user has no requests, no PI group, and has not requested account deletion */
243+
function getBlankUser()
243244
{
244245
return ["[email protected]", "foo", "bar", "[email protected]"];
245246
}
@@ -249,11 +250,6 @@ function getUserHasNoSshKeys()
249250
return ["[email protected]", "foo", "bar", "[email protected]"];
250251
}
251252

252-
function getUserNotPiNotRequestedBecomePi()
253-
{
254-
return ["[email protected]", "foo", "bar", "[email protected]"];
255-
}
256-
257253
function getUserNotPiNotRequestedBecomePiRequestedAccountDeletion()
258254
{
259255
return ["[email protected]", "foo", "bar", "[email protected]"];

0 commit comments

Comments
 (0)