diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 815fc86..28b07db 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@v6 - 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 db192ad..26d3274 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@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 1b6a774..b1c03f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,18 +6,18 @@ on: branches: [ master, main ] jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest 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@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 diff --git a/tests/acceptance/MiddlewareTest.php b/tests/acceptance/MiddlewareTest.php index 1957112..56661ec 100644 --- a/tests/acceptance/MiddlewareTest.php +++ b/tests/acceptance/MiddlewareTest.php @@ -35,18 +35,17 @@ 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); } } - 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 47fc468..fbf08d9 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 3e265bd..961856d 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 a703e3e..d298a8a 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); }