diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2757783..21bdbe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,10 +7,11 @@ on: jobs: PHPUnit: name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: php: + - 8.2 - 8.1 - 8.0 - 7.4 @@ -23,7 +24,7 @@ jobs: - 5.4 - 5.3 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -36,13 +37,16 @@ jobs: PHPUnit-hhvm: name: PHPUnit (HHVM) - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 continue-on-error: true steps: - - uses: actions/checkout@v2 - - uses: azjezz/setup-hhvm@v1 + - uses: actions/checkout@v3 + - run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM + - name: Run hhvm composer.phar install + uses: docker://hhvm/hhvm:3.30-lts-latest with: - version: lts-3.30 - - run: composer self-update --2.2 # downgrade Composer for HHVM - - run: hhvm $(which composer) install - - run: hhvm vendor/bin/phpunit + args: hhvm composer.phar install + - name: Run hhvm vendor/bin/phpunit + uses: docker://hhvm/hhvm:3.30-lts-latest + with: + args: hhvm vendor/bin/phpunit diff --git a/README.md b/README.md index 0de8a3d..7d8397f 100644 --- a/README.md +++ b/README.md @@ -642,7 +642,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require clue/stdio-react:^2.6 +composer require clue/stdio-react:^2.6 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. @@ -680,13 +680,13 @@ To run the test suite, you first need to clone this repo and then install all dependencies [through Composer](https://getcomposer.org/): ```bash -$ composer install +composer install ``` To run the test suite, go to the project root and run: ```bash -$ vendor/bin/phpunit +vendor/bin/phpunit ``` ## License diff --git a/composer.json b/composer.json index 0e86dcb..aa5b483 100644 --- a/composer.json +++ b/composer.json @@ -20,18 +20,19 @@ "require-dev": { "clue/arguments": "^2.0", "clue/commander": "^1.2", - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "suggest": { "ext-mbstring": "Using ext-mbstring should provide slightly better performance for handling I/O" }, - "config": { - "sort-packages": true - }, "autoload": { - "psr-4": { "Clue\\React\\Stdio\\": "src/" } + "psr-4": { + "Clue\\React\\Stdio\\": "src/" + } }, "autoload-dev": { - "psr-4": { "Clue\\Tests\\React\\Stdio\\": "tests/" } + "psr-4": { + "Clue\\Tests\\React\\Stdio\\": "tests/" + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e259890..21647cf 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,14 +1,14 @@ - - + - + ./tests/ @@ -17,4 +17,7 @@ ./src/ + + + diff --git a/phpunit.xml.legacy b/phpunit.xml.legacy index 6a2ef42..dbf3bbd 100644 --- a/phpunit.xml.legacy +++ b/phpunit.xml.legacy @@ -1,12 +1,12 @@ - + - + ./tests/ diff --git a/tests/FunctionalExampleTest.php b/tests/FunctionalExampleTest.php index d6d4a99..9841f56 100644 --- a/tests/FunctionalExampleTest.php +++ b/tests/FunctionalExampleTest.php @@ -38,6 +38,10 @@ public function testPeriodicExampleWithClosedInputQuitsImmediately() $this->markTestSkipped('Test fails for Github CI with PHP >= 7.0 and HHVM'); } + if (PHP_VERSION_ID === 80108 || PHP_VERSION_ID === 80107 || PHP_VERSION_ID === 80020) { + $this->markTestSkipped('Skip bugged PHP version: https://github.com/php/php-src/issues/8827'); + } + $output = $this->execExample('php 01-periodic.php <&-'); if (strpos($output, 'said') !== false) { @@ -53,6 +57,10 @@ public function testPeriodicExampleWithClosedInputAndOutputQuitsImmediatelyWitho $this->markTestSkipped('Test fails for Github CI with PHP >= 7.0 and HHVM'); } + if (PHP_VERSION_ID === 80108 || PHP_VERSION_ID === 80107 || PHP_VERSION_ID === 80020) { + $this->markTestSkipped('Skip bugged PHP version: https://github.com/php/php-src/issues/8827'); + } + $output = $this->execExample('php 01-periodic.php <&- >&- 2>&-'); if (strpos($output, 'said') !== false) { @@ -113,10 +121,6 @@ public function testStubCanEndWithoutReadlineFunctions() public function testPeriodicExampleViaInteractiveModeQuitsImmediately() { - if (getenv('CI') === 'true' && PHP_VERSION_ID >= 70000) { - $this->markTestSkipped('Test fails for Github CI with PHP >= 7.0'); - } - if (defined('HHVM_VERSION')) { $this->markTestSkipped('Skipped interactive mode on HHVM'); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 002a837..4cac972 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,10 +4,6 @@ use PHPUnit\Framework\TestCase as BaseTestCase; -require_once __DIR__ . '/../vendor/autoload.php'; - -error_reporting(-1); - class TestCase extends BaseTestCase { protected function expectCallableOnce()