Skip to content

Commit

Permalink
CI: Fixes, support phpunit v9
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed May 31, 2023
1 parent 888ab98 commit b793f36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/SieveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand All @@ -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);
Expand Down

0 comments on commit b793f36

Please sign in to comment.