From ee5ec11322c3ee08daf602aa48a6fa35b00fd511 Mon Sep 17 00:00:00 2001 From: 40handz Date: Mon, 23 Mar 2026 19:12:30 -0400 Subject: [PATCH 1/4] Update GitHub Actions workflows - actions/checkout@v2/v3 -> @v4 across all workflows - Replace deprecated actions/create-release@v1 with softprops/action-gh-release@v2.6.1 - Add PHP 8.5 to test matrix --- .github/workflows/gh-release.yml | 10 +++++----- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 815fc868..92fd3096 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup git run: | git config user.email "pusher-ci@pusher.com" @@ -24,12 +24,12 @@ jobs: export TAG=$(head -1 CHANGELOG.tmp | cut -d' ' -f2) echo "TAG=$TAG" >> $GITHUB_ENV - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2.6.1 with: tag_name: ${{ env.TAG }} - release_name: ${{ env.TAG }} + name: ${{ env.TAG }} body_path: CHANGELOG.tmp draft: false prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db192ad9..8f8c0147 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: export NEW_VERSION=$(semver bump ${{ env.RELEASE }} $CURRENT) echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup git run: | git config user.email "pusher-ci@pusher.com" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1b6a774c..bd2129a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,14 +10,14 @@ jobs: strategy: fail-fast: false matrix: - php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4] + php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.stability }} Test steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 From 1f2b835745583aeab0ce9deadbf0f8d567ed2d97 Mon Sep 17 00:00:00 2001 From: 40handz Date: Tue, 24 Mar 2026 10:20:29 -0400 Subject: [PATCH 2/4] Bump actions/checkout to v6, use ubuntu-latest runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - actions/checkout@v4/v3 → @v6 across all three workflows - ubuntu-20.04 → ubuntu-latest in test.yml --- .github/workflows/gh-release.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 92fd3096..28b07db1 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup git run: | git config user.email "pusher-ci@pusher.com" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f8c0147..26d32743 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: export NEW_VERSION=$(semver bump ${{ env.RELEASE }} $CURRENT) echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup git run: | git config user.email "pusher-ci@pusher.com" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd2129a2..b1c03f45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: branches: [ master, main ] jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -36,7 +36,7 @@ jobs: - name: Run unit tests run: composer exec phpunit tests/unit - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: repository: pusher/public_actions path: .github/actions From 66a2878538fa30b8a87b3d260caf5eb1d1176f2c Mon Sep 17 00:00:00 2001 From: 40handz Date: Tue, 24 Mar 2026 10:31:09 -0400 Subject: [PATCH 3/4] Fix acceptance tests passing raw string as event data The Pusher Channels API requires event data to be a JSON object. Passing a raw PHP string causes json_encode to produce a bare JSON string (e.g. "Test string"), which the API rejects with "Invalid JSON provided (could not parse)". Changed test data from 'Test string' to ['message' => 'Test string'] and renamed testStringPush to testEventPush to reflect what each test is actually asserting. --- tests/acceptance/MiddlewareTest.php | 4 ++-- tests/acceptance/SendToUserTest.php | 4 ++-- tests/acceptance/TriggerAsyncTest.php | 4 ++-- tests/acceptance/TriggerTest.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/MiddlewareTest.php b/tests/acceptance/MiddlewareTest.php index 1957112e..0bab1b25 100644 --- a/tests/acceptance/MiddlewareTest.php +++ b/tests/acceptance/MiddlewareTest.php @@ -43,10 +43,10 @@ protected function setUp(): void } } - public function testStringPush(): void + public function testEventPush(): void { self::assertEquals(0, $this->count); - $result = $this->pusher->trigger('test_channel', 'my_event', 'Test string'); + $result = $this->pusher->trigger('test_channel', 'my_event', ['message' => 'Test string']); self::assertEquals(1, $this->count); } } diff --git a/tests/acceptance/SendToUserTest.php b/tests/acceptance/SendToUserTest.php index 47fc4688..fbf08d98 100644 --- a/tests/acceptance/SendToUserTest.php +++ b/tests/acceptance/SendToUserTest.php @@ -32,13 +32,13 @@ protected function setUp(): void public function testSendToUser(): void { - $result = $this->pusher->sendToUser('123', 'my_event', 'Test string'); + $result = $this->pusher->sendToUser('123', 'my_event', ['message' => 'Test string']); self::assertEquals(new stdClass(), $result); } public function testSendToUserAsync(): void { - $result = $this->pusher->sendToUserAsync('123', 'my_event', 'Test string')->wait(); + $result = $this->pusher->sendToUserAsync('123', 'my_event', ['message' => 'Test string'])->wait(); self::assertEquals(new stdClass(), $result); } diff --git a/tests/acceptance/TriggerAsyncTest.php b/tests/acceptance/TriggerAsyncTest.php index 3e265bd4..961856d4 100644 --- a/tests/acceptance/TriggerAsyncTest.php +++ b/tests/acceptance/TriggerAsyncTest.php @@ -29,9 +29,9 @@ public function testObjectConstruct(): void self::assertNotNull($this->pusher, 'Created new \Pusher\Pusher object'); } - public function testStringPush(): void + public function testEventPush(): void { - $result = $this->pusher->triggerAsync('test_channel', 'my_event', 'Test string')->wait(); + $result = $this->pusher->triggerAsync('test_channel', 'my_event', ['message' => 'Test string'])->wait(); self::assertEquals(new stdClass(), $result); } diff --git a/tests/acceptance/TriggerTest.php b/tests/acceptance/TriggerTest.php index a703e3ed..d298a8af 100644 --- a/tests/acceptance/TriggerTest.php +++ b/tests/acceptance/TriggerTest.php @@ -31,9 +31,9 @@ public function testObjectConstruct(): void self::assertNotNull($this->pusher, 'Created new \Pusher\Pusher object'); } - public function testStringPush(): void + public function testEventPush(): void { - $result = $this->pusher->trigger('test_channel', 'my_event', 'Test string'); + $result = $this->pusher->trigger('test_channel', 'my_event', ['message' => 'Test string']); self::assertEquals(new stdClass(), $result); } From 3330b31b6584ee3fab14074396d3c19d33ae9f23 Mon Sep 17 00:00:00 2001 From: 40handz Date: Tue, 24 Mar 2026 10:39:41 -0400 Subject: [PATCH 4/4] Fix MiddlewareTest using bare HandlerStack new HandlerStack() skips Guzzle's default middleware (including prepareBody), causing requests to be malformed and rejected by the API. Changed to HandlerStack::create() which includes the full default middleware stack while still allowing the custom increment middleware to be pushed on top. --- tests/acceptance/MiddlewareTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/acceptance/MiddlewareTest.php b/tests/acceptance/MiddlewareTest.php index 0bab1b25..56661ecd 100644 --- a/tests/acceptance/MiddlewareTest.php +++ b/tests/acceptance/MiddlewareTest.php @@ -35,8 +35,7 @@ protected function setUp(): void PUSHERAPP_AUTHKEY, PUSHERAPP_SECRET and PUSHERAPP_APPID keys.'); } else { - $stack = new HandlerStack(); - $stack->setHandler(new CurlHandler()); + $stack = HandlerStack::create(new CurlHandler()); $stack->push($this->increment()); $client = new Client(['handler' => $stack]); $this->pusher = new Pusher(PUSHERAPP_AUTHKEY, PUSHERAPP_SECRET, PUSHERAPP_APPID, ['cluster' => PUSHERAPP_CLUSTER], $client);