diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 366d72a..dc9cf4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: strategy: matrix: php: + - 8.0 - 7.4 - 7.3 - 7.2 @@ -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 diff --git a/README.md b/README.md index 2ec6219..a0f3ebb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/tests/TestCase.php b/tests/TestCase.php index 7bef2f5..af07e3e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -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); + } + } } diff --git a/tests/WritableResourceStreamTest.php b/tests/WritableResourceStreamTest.php index 7b36418..f0a3b42 100644 --- a/tests/WritableResourceStreamTest.php +++ b/tests/WritableResourceStreamTest.php @@ -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()