Skip to content

Commit 8721eed

Browse files
committed
catch redirect exception is now in http_post
1 parent 43ee084 commit 8721eed

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

test/functional/NewUserTest.php

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,26 @@ private function assertNumberGroupRequests(int $x)
1414

1515
private function requestGroupCreation()
1616
{
17-
$redirectedOrDied = false;
18-
try {
19-
http_post(
20-
__DIR__ . "/../../webroot/panel/new_account.php",
21-
["new_user_sel" => "pi", "eula" => "agree", "confirm_pi" => "agree"]
22-
);
23-
} catch (\UnityWebPortal\lib\exceptions\PhpUnitNoDieException) {
24-
$redirectedOrDied = true;
25-
}
26-
$this->assertTrue($redirectedOrDied);
17+
http_post(
18+
__DIR__ . "/../../webroot/panel/new_account.php",
19+
["new_user_sel" => "pi", "eula" => "agree", "confirm_pi" => "agree"]
20+
);
2721
}
2822

2923
private function requestGroupMembership(string $gid)
3024
{
31-
$redirectedOrDied = false;
32-
try {
33-
http_post(
34-
__DIR__ . "/../../webroot/panel/new_account.php",
35-
["new_user_sel" => "not_pi", "eula" => "agree", "pi" => $gid]
36-
);
37-
} catch (\UnityWebPortal\lib\exceptions\PhpUnitNoDieException) {
38-
$redirectedOrDied = true;
39-
}
40-
$this->assertTrue($redirectedOrDied);
25+
http_post(
26+
__DIR__ . "/../../webroot/panel/new_account.php",
27+
["new_user_sel" => "not_pi", "eula" => "agree", "pi" => $gid]
28+
);
4129
}
4230

4331
private function cancelAllRequests()
4432
{
45-
$redirectedOrDied = false;
46-
try {
47-
http_post(
48-
__DIR__ . "/../../webroot/panel/new_account.php",
49-
["cancel" => "true"] // value of cancel is arbitrary
50-
);
51-
} catch (\UnityWebPortal\lib\exceptions\PhpUnitNoDieException) {
52-
$redirectedOrDied = true;
53-
}
54-
$this->assertTrue($redirectedOrDied);
33+
http_post(
34+
__DIR__ . "/../../webroot/panel/new_account.php",
35+
["cancel" => "true"] // value of cancel is arbitrary
36+
);
5537
}
5638

5739
// delete requests made by that user

0 commit comments

Comments
 (0)