diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b862e61..53fa306 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,9 @@ jobs: - name: "Install Linux dependencies" timeout-minutes: 1 run: | + php -i | grep assert + php --ini + false sudo apt-get update && sudo apt-get install -y \ composer @@ -38,7 +41,8 @@ jobs: timeout-minutes: 1 run: | export XDEBUG_MODE=off - composer check + composer unit + false - name: "Check code coverage min percentage" timeout-minutes: 4 diff --git a/composer.json b/composer.json index 7027fdb..3d87c80 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "scripts": { "stan": "php vendor/bin/phpstan --memory-limit=300M analyze", "unit": "php vendor/bin/phpunit -d memory_limit=70M", - "infection": "php -d zend.assertions=1 -d memory_limit=180M vendor/bin/infection --show-mutations --only-covered --threads=6 --min-covered-msi=100", + "infection": "php -d memory_limit=180M vendor/bin/infection --show-mutations --only-covered --threads=6 --min-covered-msi=100", "infection-cache": "@infection --coverage=www/coverage/", "dev": "php cli/server.php 1 8080 --debug & php cli/udp-ws-bridge.php", "dev2": "php cli/server.php 2 8080 --debug & php cli/udp-ws-bridge.php & php cli/udp-ws-bridge.php 8082", diff --git a/test/og/Game/RoundTest.php b/test/og/Game/RoundTest.php index a5d1034..d0e3751 100644 --- a/test/og/Game/RoundTest.php +++ b/test/og/Game/RoundTest.php @@ -34,6 +34,7 @@ public function testMsToTickConstantTenOnTest(): void $this->assertSame(0, Util::millisecondsToFrames(0)); $this->assertSame(1, Util::millisecondsToFrames(1)); $this->assertSame(1, Util::millisecondsToFrames(10)); + assert(false); $this->assertSame(123, Util::millisecondsToFrames(1230)); $this->assertSame(240, Util::millisecondsToFrames(RifleAk::reloadTimeMs)); } diff --git a/test/og/Unit/UtilTest.php b/test/og/Unit/UtilTest.php index 24810d0..aff452a 100644 --- a/test/og/Unit/UtilTest.php +++ b/test/og/Unit/UtilTest.php @@ -13,6 +13,12 @@ class UtilTest extends BaseTest { + public function testAssertionsEnabled(): void + { + $this->expectException('\AssertionError'); + assert(false); + } + public function testNegativeTime(): void { $this->expectExceptionMessage('Negative time given');