From 7a5d832d0e2f20e0b3dcdefa409b4cfd8bad8262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 21 Jun 2022 22:52:45 +0200 Subject: [PATCH] Forward compatibility with upcoming Promise v3 --- .github/workflows/ci.yml | 3 +++ composer.json | 17 +++++++++++------ tests/ProxyConnectorTest.php | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae61063..081fe14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: with: php-version: ${{ matrix.php }} coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: composer install - run: vendor/bin/phpunit --coverage-text if: ${{ matrix.php >= 7.3 }} @@ -37,6 +39,7 @@ jobs: name: PHPUnit (HHVM) runs-on: ubuntu-18.04 continue-on-error: true + if: false # temporarily skipped until https://github.com/azjezz/setup-hhvm/issues/3 is addressed steps: - uses: actions/checkout@v2 - uses: azjezz/setup-hhvm@v1 diff --git a/composer.json b/composer.json index 9840cf0..fc23ef2 100644 --- a/composer.json +++ b/composer.json @@ -12,20 +12,25 @@ ], "require": { "php": ">=5.3", - "react/promise": " ^2.1 || ^1.2.1", - "react/socket": "^1.9", + "react/promise": "^3@dev || ^2.1 || ^1.2.1", + "react/socket": "dev-promise-3 as 1.12.0", "ringcentral/psr7": "^1.2" }, "require-dev": { - "clue/block-react": "^1.1", + "clue/block-react": "^1.5", "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8", - "react/event-loop": "^1.2", - "react/http": "^1.5" + "react/event-loop": "^1.2" }, "autoload": { "psr-4": { "Clue\\React\\HttpProxy\\": "src/" } }, "autoload-dev": { "psr-4": { "Clue\\Tests\\React\\HttpProxy\\": "tests/" } - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/WyriHaximus-labs/socket" + } + ] } diff --git a/tests/ProxyConnectorTest.php b/tests/ProxyConnectorTest.php index 59fc466..0b8c155 100644 --- a/tests/ProxyConnectorTest.php +++ b/tests/ProxyConnectorTest.php @@ -137,7 +137,7 @@ public function testCancelPromiseWillCancelPendingConnection() $promise = $proxy->connect('google.com:80'); - $this->assertInstanceOf('React\Promise\CancellablePromiseInterface', $promise); + $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); $promise->cancel(); } @@ -477,7 +477,7 @@ public function testCancelPromiseWhileConnectionIsReadyWillCloseOpenConnectionAn $deferred->resolve($stream); - $this->assertInstanceOf('React\Promise\CancellablePromiseInterface', $promise); + $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); $promise->cancel();