Skip to content

Commit 6ef5fd3

Browse files
committed
tests: check for enabled assertions
1 parent 5ed840b commit 6ef5fd3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,8 @@ jobs:
4747
- name: Run phpstan
4848
run: composer phpstan
4949

50+
- name: Enable zend.assertions for tests # we need to do this in the whole system to enabled it also for PHPCS itself
51+
run: echo "zend.assertions = 1" >> /etc/php/${{ matrix.php-versions }}/cli/php.ini
52+
5053
- name: Run tests
5154
run: composer tests

tests/run-tests.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ final class TestsRunner
3333

3434
public function run(): bool
3535
{
36+
if (ini_get('zend.assertions') !== '1') {
37+
throw new \RuntimeException('zend.assertions must be enabled in the system (zend.assertions = 1)');
38+
}
39+
3640
$success = $this->runTests(
3741
'Test correct phpcs.xml (no ignores, expecting no errors)',
3842
fn (): bool => $this->tests1(),

0 commit comments

Comments
 (0)