Skip to content

Commit fb4cf11

Browse files
committed
Support PHP 8
1 parent 2f5e3c9 commit fb4cf11

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.0
1415
- 7.4
1516
- 7.3
1617
- 7.2
@@ -41,7 +42,7 @@ jobs:
4142
- uses: actions/checkout@v2
4243
- uses: shivammathur/setup-php@v2
4344
with:
44-
php-version: 7.4
45+
php-version: 8.0
4546
coverage: xdebug
4647
- run: composer install
4748
- run: vendor/bin/phpunit --coverage-text

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ $ composer require react/stream:^1.1.1
11851185
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
11861186

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

tests/TestCase.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,15 @@ public function assertContainsStringIgnoringCase($needle, $haystack)
8686
$this->assertContains($needle, $haystack, '', true);
8787
}
8888
}
89+
90+
public function assertSameIgnoringCase($expected, $actual)
91+
{
92+
if (method_exists($this, 'assertEqualsIgnoringCase')) {
93+
// PHPUnit 7.5+
94+
$this->assertEqualsIgnoringCase($expected, $actual);
95+
} else {
96+
// legacy PHPUnit 4 - PHPUnit 7.5
97+
$this->assertSame($expected, $actual);
98+
}
99+
}
89100
}

tests/WritableResourceStreamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function testWritingToClosedStream()
485485
$buffer->handleWrite();
486486

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

491491
private function createWriteableLoopMock()

0 commit comments

Comments
 (0)