Skip to content
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

Test on PHP 8.3 and update test environment #269

Merged
merged 1 commit into from
Oct 24, 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
10 changes: 6 additions & 4 deletions .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.3
- 8.2
- 8.1
- 8.0
Expand All @@ -24,7 +25,7 @@ jobs:
- 5.4
- 5.3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
- 5.4
- 5.3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
strategy:
matrix:
php:
- 8.3
- 8.2
- 8.1
- 8.0
Expand All @@ -114,7 +116,7 @@ jobs:
- 7.2
- 7.1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -132,7 +134,7 @@ jobs:
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- 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
Expand Down
33 changes: 15 additions & 18 deletions tests/LoopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use React\EventLoop\Factory;
use React\EventLoop\Loop;
use ReflectionClass;

final class LoopTest extends TestCase
{
Expand Down Expand Up @@ -66,7 +65,7 @@ public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewL
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = stream_socket_server('127.0.0.1:0');
$listener = function () { };
Expand All @@ -92,7 +91,7 @@ public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNe
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = stream_socket_server('127.0.0.1:0');
$listener = function () { };
Expand All @@ -117,7 +116,7 @@ public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = tmpfile();
Loop::removeReadStream($stream);
Expand All @@ -141,7 +140,7 @@ public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = tmpfile();
Loop::removeWriteStream($stream);
Expand Down Expand Up @@ -169,7 +168,7 @@ public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstanc
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$interval = 1.0;
$callback = function () { };
Expand Down Expand Up @@ -199,7 +198,7 @@ public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimer
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$interval = 1.0;
$callback = function () { };
Expand All @@ -226,7 +225,7 @@ public function testStaticCancelTimerWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock();
Loop::cancelTimer($timer);
Expand All @@ -250,7 +249,7 @@ public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopIns
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$listener = function () { };
Loop::futureTick($listener);
Expand Down Expand Up @@ -279,7 +278,7 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta

$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$signal = 1;
$listener = function () { };
Expand Down Expand Up @@ -309,7 +308,7 @@ public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$signal = 1;
$listener = function () { };
Expand All @@ -332,7 +331,7 @@ public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

Loop::run();

Expand All @@ -353,7 +352,7 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

Loop::stop();

Expand All @@ -366,10 +365,8 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
*/
public function unsetLoopFromLoopAccessor()
{
$ref = new ReflectionClass('\React\EventLoop\Loop');
$prop = $ref->getProperty('instance');
$prop->setAccessible(true);
$prop->setValue(null);
$prop->setAccessible(false);
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null, null);
}
}