diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d5140a97..36778543 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -6,7 +6,7 @@ on: branches: [main] jobs: - pre-commit: + phpstan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -17,4 +17,4 @@ jobs: php-version: "8.3" tools: composer - run: composer install --dev - - run: ./vendor/bin/phpstan --memory-limit=-1 analyse ./resources/ + - run: ./vendor/bin/phpstan analyse -c phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..24e5d6ae --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 0 + paths: + - resources + - test diff --git a/test/functional/AccountDeletionRequestTest.php b/test/functional/AccountDeletionRequestTest.php index d8c4bb04..ad2fc8f3 100644 --- a/test/functional/AccountDeletionRequestTest.php +++ b/test/functional/AccountDeletionRequestTest.php @@ -14,7 +14,7 @@ private function assertNumberAccountDeletionRequests(int $x) $this->assertTrue($USER->hasRequestedAccountDeletion()); $this->assertTrue($SQL->accDeletionRequestExists($USER->uid)); } else { - throw new RuntimeError("x must not be negative"); + throw new RuntimeException("x must not be negative"); } $this->assertEquals($x, $this->getNumberAccountDeletionRequests()); } diff --git a/test/functional/PiBecomeRequestTest.php b/test/functional/PiBecomeRequestTest.php index 6a549a5b..317a1bdd 100644 --- a/test/functional/PiBecomeRequestTest.php +++ b/test/functional/PiBecomeRequestTest.php @@ -13,7 +13,7 @@ private function assertNumberPiBecomeRequests(int $x) } elseif ($x > 0) { $this->assertTrue($SQL->requestExists($USER->uid)); } else { - throw new RuntimeError("x must not be negative"); + throw new RuntimeException("x must not be negative"); } $this->assertEquals($x, $this->getNumberPiBecomeRequests()); } diff --git a/test/functional/PiMemberDenyTest.php b/test/functional/PiMemberDenyTest.php index 373bab5b..bb5ca84e 100644 --- a/test/functional/PiMemberDenyTest.php +++ b/test/functional/PiMemberDenyTest.php @@ -17,7 +17,7 @@ public static function setUpBeforeClass(): void private function denyUser(string $uid) { - post(__DIR__ . "/../../webroot/panel/pi.php", [ + http_post(__DIR__ . "/../../webroot/panel/pi.php", [ "form_type" => "userReq", "action" => "approve", "uid" => $uid,