diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd6f7f7..97e0c85 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,6 +31,12 @@ jobs: tools: composer:v2 coverage: none + - name: Setup tests for PHP < 7.4 + if: matrix.php < 7.4 + run: | + composer require --dev 'phpunit/phpunit:^4.8.36 || ^5.7.21 || ^6 || ^7' --no-update + sed -i 's/: void//g' tests/*.php + - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-progress diff --git a/composer.json b/composer.json index 951f04e..f4e8af7 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "pear/net_socket": "~1.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7" + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^9" }, "suggest": { "pear/auth_sasl": "Install optionally via your project's composer.json" diff --git a/tests/SieveTest.php b/tests/SieveTest.php index 8e208f1..58e4bbe 100644 --- a/tests/SieveTest.php +++ b/tests/SieveTest.php @@ -57,7 +57,7 @@ class SieveTest extends PHPUnit\Framework\TestCase // contains the object handle of the string class protected $fixture; - protected function setUp() + protected function setUp(): void { if (!file_exists(dirname(__FILE__) . '/config.php')) { $this->markTestSkipped('Test configuration incomplete. Copy config.php.dist to config.php.'); @@ -74,7 +74,7 @@ protected function setUp() 'test script4' => file_get_contents(dirname(__FILE__) . '/largescript.siv')); } - protected function tearDown() + protected function tearDown(): void { // Delete the instance. unset($this->fixture);