Skip to content

Commit

Permalink
Support PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonFrings committed Feb 9, 2021
1 parent 2f5e3c9 commit fb4cf11
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
php:
- 8.0
- 7.4
- 7.3
- 7.2
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: xdebug
- run: composer install
- run: vendor/bin/phpunit --coverage-text
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ $ composer require react/stream:^1.1.1
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.

This project aims to run on any platform and thus does not require any PHP
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and HHVM.
extensions and supports running on legacy PHP 5.3 through current PHP 8+ and HHVM.
It's *highly recommended to use PHP 7+* for this project due to its vast
performance improvements.

Expand Down
11 changes: 11 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,15 @@ public function assertContainsStringIgnoringCase($needle, $haystack)
$this->assertContains($needle, $haystack, '', true);
}
}

public function assertSameIgnoringCase($expected, $actual)
{
if (method_exists($this, 'assertEqualsIgnoringCase')) {
// PHPUnit 7.5+
$this->assertEqualsIgnoringCase($expected, $actual);
} else {
// legacy PHPUnit 4 - PHPUnit 7.5
$this->assertSame($expected, $actual);
}
}
}
2 changes: 1 addition & 1 deletion tests/WritableResourceStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public function testWritingToClosedStream()
$buffer->handleWrite();

$this->assertInstanceOf('Exception', $error);
$this->assertSame('Unable to write to stream: fwrite(): send of 3 bytes failed with errno=32 Broken pipe', $error->getMessage());
$this->assertSameIgnoringCase('Unable to write to stream: fwrite(): send of 3 bytes failed with errno=32 Broken pipe', $error->getMessage());
}

private function createWriteableLoopMock()
Expand Down

0 comments on commit fb4cf11

Please sign in to comment.