Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 491d164

Browse files
authored
Tests fixes (#908)
1 parent 6beed7d commit 491d164

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
php:
2223
- '7.3'
2324
- '7.4'
2425
- '8.0'
26+
- '8.1'
2527
laravel:
2628
- 6.*
2729
- 7.*
@@ -32,15 +34,27 @@ jobs:
3234
include:
3335
- laravel: '6.*'
3436
testbench: '4.*'
37+
phpunit: '^8.5.8|^9.3.3'
3538
- laravel: '7.*'
3639
testbench: '5.*'
40+
phpunit: '^8.5.8|^9.3.3'
3741
- laravel: '8.*'
3842
testbench: '6.*'
43+
phpunit: '^9.3.3'
3944
exclude:
4045
- php: '8.0'
4146
laravel: 6.*
47+
prefer: 'prefer-lowest'
4248
- php: '8.0'
4349
laravel: 7.*
50+
prefer: 'prefer-lowest'
51+
- php: '8.1'
52+
laravel: 6.*
53+
- php: '8.1'
54+
laravel: 7.*
55+
- php: '8.1'
56+
laravel: 8.*
57+
prefer: 'prefer-lowest'
4458

4559
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} --${{ matrix.prefer }}
4660

@@ -67,7 +81,7 @@ jobs:
6781

6882
- name: Install dependencies
6983
run: |
70-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update
84+
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update
7185
composer update --${{ matrix.prefer }} --prefer-dist --no-interaction --no-suggest
7286
7387
- name: Run tests for Local

‎composer.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@
3030
],
3131
"require": {
3232
"cboden/ratchet": "^0.4.1",
33-
"clue/redis-react": "^2.3",
33+
"clue/redis-react": "^2.5",
3434
"evenement/evenement": "^2.0|^3.0",
3535
"facade/ignition-contracts": "^1.0",
36-
"guzzlehttp/psr7": "^1.5|^2.0",
36+
"guzzlehttp/psr7": "^1.7|^2.0",
3737
"illuminate/broadcasting": "^6.3|^7.0|^8.0",
3838
"illuminate/console": "^6.3|^7.0|^8.0",
3939
"illuminate/http": "^6.3|^7.0|^8.0",
4040
"illuminate/queue": "^6.3|^7.0|^8.0",
4141
"illuminate/routing": "^6.3|^7.0|^8.0",
4242
"illuminate/support": "^6.3|^7.0|^8.0",
4343
"pusher/pusher-php-server": "^3.0|^4.0|^5.0|^6.0|^7.0",
44-
"react/promise": "^2.0",
45-
"symfony/http-kernel": "^4.0|^5.0",
44+
"react/promise": "^2.8",
45+
"symfony/http-kernel": "^4.4|^5.4",
4646
"symfony/psr-http-message-bridge": "^1.1|^2.0"
4747
},
4848
"require-dev": {
4949
"clue/block-react": "^1.4",
5050
"laravel/legacy-factories": "^1.1",
5151
"orchestra/testbench-browser-kit": "^4.0|^5.0|^6.0",
52-
"phpunit/phpunit": "^8.0|^9.0"
52+
"phpunit/phpunit": "^8.5.8|^9.3.3"
5353
},
5454
"suggest": {
5555
"ext-pcntl": "Running the server needs pcntl to listen to command signals and soft-shutdown.",

‎src/API/Controller.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use BeyondCode\LaravelWebSockets\Contracts\ChannelManager;
77
use BeyondCode\LaravelWebSockets\Server\QueryParameters;
88
use Exception;
9+
use GuzzleHttp\Psr7\Message;
910
use GuzzleHttp\Psr7\Response;
1011
use GuzzleHttp\Psr7\ServerRequest;
1112
use Illuminate\Http\JsonResponse;
@@ -139,7 +140,7 @@ public function onError(ConnectionInterface $connection, Exception $exception)
139140
'error' => $exception->getMessage(),
140141
]));
141142

142-
tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close();
143+
tap($connection)->send(Message::toString($response))->close();
143144
}
144145

145146
/**

‎src/Dashboard/Http/Controllers/SendMessage.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use BeyondCode\LaravelWebSockets\Concerns\PushesToPusher;
66
use BeyondCode\LaravelWebSockets\Rules\AppId;
7-
use Exception;
87
use Illuminate\Http\Request;
8+
use Throwable;
99

1010
class SendMessage
1111
{
@@ -42,7 +42,7 @@ public function __invoke(Request $request)
4242
$request->event,
4343
$decodedData ?: []
4444
);
45-
} catch (Exception $e) {
45+
} catch (Throwable $e) {
4646
return response()->json([
4747
'ok' => false,
4848
'exception' => $e->getMessage(),

‎src/Server/HealthHandler.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace BeyondCode\LaravelWebSockets\Server;
44

55
use Exception;
6+
use GuzzleHttp\Psr7\Message;
67
use GuzzleHttp\Psr7\Response;
78
use Psr\Http\Message\RequestInterface;
89
use Ratchet\ConnectionInterface;
@@ -25,7 +26,7 @@ public function onOpen(ConnectionInterface $connection, RequestInterface $reques
2526
json_encode(['ok' => true])
2627
);
2728

28-
tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close();
29+
tap($connection)->send(Message::toString($response))->close();
2930
}
3031

3132
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /