Skip to content

Test on PHP 8.2 and update test environment #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
}
}
13 changes: 8 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheResult="false"
colors="true"
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="Stdio React Test Suite">
<testsuite name="Stdio Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand All @@ -17,4 +17,7 @@
<directory>./src/</directory>
</include>
</coverage>
<php>
<ini name="error_reporting" value="-1" />
</php>
</phpunit>
4 changes: 2 additions & 2 deletions phpunit.xml.legacy
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
<!-- PHPUnit configuration file with old format for legacy PHPUnit -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Stdio React Test Suite">
<testsuite name="Stdio Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand Down
12 changes: 8 additions & 4 deletions tests/FunctionalExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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');
}
Expand Down
4 changes: 0 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down