Skip to content

Commit 22b8b41

Browse files
committed
rename post to http_post, get to http_get
1 parent 62e6972 commit 22b8b41

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

test/functional/AccountDeletionRequestTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public function testRequestAccountDeletionUserHasNoGroups()
3838
$this->assertEmpty($USER->getGroups());
3939
$this->assertNumberAccountDeletionRequests(0);
4040
try {
41-
post(
41+
http_post(
4242
__DIR__ . "/../../webroot/panel/account.php",
4343
["form_type" => "account_deletion_request"]
4444
);
4545
$this->assertNumberAccountDeletionRequests(1);
46-
post(
46+
http_post(
4747
__DIR__ . "/../../webroot/panel/account.php",
4848
["form_type" => "account_deletion_request"]
4949
);
@@ -62,7 +62,7 @@ public function testRequestAccountDeletionUserHasGroup()
6262
$this->assertNotEmpty($USER->getGroups());
6363
$this->assertNumberAccountDeletionRequests(0);
6464
try {
65-
post(
65+
http_post(
6666
__DIR__ . "/../../webroot/panel/account.php",
6767
["form_type" => "account_deletion_request"]
6868
);

test/functional/LoginShellSetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testSetLoginShell(string $shell): void
4444
if (!$this->isShellValid($shell)) {
4545
$this->expectException("Exception");
4646
}
47-
post(
47+
http_post(
4848
__DIR__ . "/../../webroot/panel/account.php",
4949
["form_type" => "loginshell", "shellSelect" => $shell]
5050
);

test/functional/PiBecomeRequestTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public function testRequestBecomePi()
3838
$this->assertFalse($USER->isPI());
3939
$this->assertNumberPiBecomeRequests(0);
4040
try {
41-
post(
41+
http_post(
4242
__DIR__ . "/../../webroot/panel/account.php",
4343
["form_type" => "pi_request"]
4444
);
4545
$this->assertNumberPiBecomeRequests(1);
46-
post(
46+
http_post(
4747
__DIR__ . "/../../webroot/panel/account.php",
4848
["form_type" => "pi_request"]
4949
);
@@ -61,7 +61,7 @@ public function testRequestBecomePiUserRequestedAccountDeletion()
6161
$this->assertNumberPiBecomeRequests(0);
6262
$this->assertTrue($SQL->accDeletionRequestExists($USER->getUID()));
6363
try {
64-
post(
64+
http_post(
6565
__DIR__ . "/../../webroot/panel/account.php",
6666
["form_type" => "pi_request"]
6767
);

test/functional/SSHKeyAddTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SSHKeyAddTest extends TestCase
99
{
1010
private function addSshKeysPaste(array $keys): void {
1111
foreach ($keys as $key) {
12-
post(
12+
http_post(
1313
__DIR__ . "/../../webroot/panel/account.php",
1414
[
1515
"form_type" => "addKey",
@@ -27,7 +27,7 @@ private function addSshKeysImport(array $keys): void {
2727
fwrite($tmp, $key);
2828
$_FILES["keyfile"] = ["tmp_name" => $tmp_path];
2929
try {
30-
post(
30+
http_post(
3131
__DIR__ . "/../../webroot/panel/account.php",
3232
["form_type" => "addKey", "add_type" => "import"]
3333
);
@@ -40,7 +40,7 @@ private function addSshKeysImport(array $keys): void {
4040

4141
private function addSshKeysGenerate(array $keys): void {
4242
foreach ($keys as $key) {
43-
post(
43+
http_post(
4444
__DIR__ . "/../../webroot/panel/account.php",
4545
[
4646
"form_type" => "addKey",
@@ -57,7 +57,7 @@ private function addSshKeysGithub(array $keys): void {
5757
$GITHUB = $this->createMock(UnityGithub::class);
5858
$GITHUB->method("getSshPublicKeys")->willReturn($keys);
5959
try {
60-
post(
60+
http_post(
6161
__DIR__ . "/../../webroot/panel/account.php",
6262
[
6363
"form_type" => "addKey",

test/functional/SSHKeyDeleteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static function setUpBeforeClass(): void{
1313
}
1414

1515
private function deleteKey(string $index): void {
16-
post(
16+
http_post(
1717
__DIR__ . "/../../webroot/panel/account.php",
1818
["form_type" => "delKey", "delIndex" => $index]
1919
);

test/functional/ViewAsUserTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testViewAsUser()
1616
$originalUid = $USER->getUID();
1717
$this->assertNotEquals($newUid, $originalUid);
1818
try {
19-
post(
19+
http_post(
2020
__DIR__ . "/../../webroot/admin/user-mgmt.php",
2121
[
2222
"form_name" => "viewAsUser",
@@ -28,12 +28,12 @@ public function testViewAsUser()
2828
// redirect means that php process dies and user's browser will initiate a new one
2929
// this makes `require_once autoload.php` run again and init.php changes $USER
3030
session_write_close();
31-
get(__DIR__ . "/../../resources/init.php");
31+
http_get(__DIR__ . "/../../resources/init.php");
3232
// now we should be new user
3333
$this->assertEquals($newUid, $USER->getUID());
3434
$this->assertTrue($_SESSION["user_exists"]);
3535
try {
36-
post(
36+
http_post(
3737
__DIR__ . "/../../resources/templates/header.php",
3838
["form_name" => "clearView"],
3939
);
@@ -42,7 +42,7 @@ public function testViewAsUser()
4242
// redirect means that php process dies and user's browser will initiate a new one
4343
// this makes `require_once autoload.php` run again and init.php changes $USER
4444
session_write_close();
45-
get(__DIR__ . "/../../resources/init.php");
45+
http_get(__DIR__ . "/../../resources/init.php");
4646
// now we should be back to original user
4747
$this->assertEquals($originalUid, $USER->getUID());
4848
}

test/phpunit-bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function switchUser(
6969
assert(!is_null($USER));
7070
}
7171

72-
function post(string $phpfile, array $post_data): void
72+
function http_post(string $phpfile, array $post_data): void
7373
{
7474
global $CONFIG, $REDIS, $LDAP, $SQL, $MAILER, $WEBHOOK, $GITHUB, $SITE, $SSO, $OPERATOR, $USER, $SEND_PIMESG_TO_ADMINS, $LOC_HEADER, $LOC_FOOTER;
7575
$_SERVER["REQUEST_METHOD"] = "POST";

0 commit comments

Comments
 (0)