Skip to content

Commit 06dbb2a

Browse files
committed
add test case for user requested account deletion
1 parent 632d394 commit 06dbb2a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/functional/PiBecomeRequestTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,22 @@ public function testRequestBecomePi()
5252
$SQL->removeRequest($USER->getUID());
5353
}
5454
}
55+
56+
public function testRequestBecomePiUserRequestedAccountDeletion()
57+
{
58+
global $USER, $SQL;
59+
switchUser(...getUserNotPiNotRequestedBecomePiRequestedAccountDeletion());
60+
$this->assertFalse($USER->isPI());
61+
$this->assertNumberPiBecomeRequests(0);
62+
$this->assertTrue($SQL->accDeletionRequestExists($USER->getUID()));
63+
try {
64+
post(
65+
__DIR__ . "/../../webroot/panel/account.php",
66+
["form_type" => "pi_request"]
67+
);
68+
$this->assertNumberPiBecomeRequests(0);
69+
} finally {
70+
$SQL->removeRequest($USER->getUID());
71+
}
72+
}
5573
}

test/phpunit-bootstrap.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,8 @@ function getUserNotPiNotRequestedBecomePi()
9999
{
100100
return ["[email protected]", "foo", "bar", "[email protected]"];
101101
}
102+
103+
function getUserNotPiNotRequestedBecomePiRequestedAccountDeletion()
104+
{
105+
return ["[email protected]", "foo", "bar", "[email protected]"];
106+
}

0 commit comments

Comments
 (0)