Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Tests fixes (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Jan 5, 2022
1 parent 6beed7d commit 491d164
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
laravel:
- 6.*
- 7.*
Expand All @@ -32,15 +34,27 @@ jobs:
include:
- laravel: '6.*'
testbench: '4.*'
phpunit: '^8.5.8|^9.3.3'
- laravel: '7.*'
testbench: '5.*'
phpunit: '^8.5.8|^9.3.3'
- laravel: '8.*'
testbench: '6.*'
phpunit: '^9.3.3'
exclude:
- php: '8.0'
laravel: 6.*
prefer: 'prefer-lowest'
- php: '8.0'
laravel: 7.*
prefer: 'prefer-lowest'
- php: '8.1'
laravel: 6.*
- php: '8.1'
laravel: 7.*
- php: '8.1'
laravel: 8.*
prefer: 'prefer-lowest'

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

Expand All @@ -67,7 +81,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.prefer }} --prefer-dist --no-interaction --no-suggest
- name: Run tests for Local
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@
],
"require": {
"cboden/ratchet": "^0.4.1",
"clue/redis-react": "^2.3",
"clue/redis-react": "^2.5",
"evenement/evenement": "^2.0|^3.0",
"facade/ignition-contracts": "^1.0",
"guzzlehttp/psr7": "^1.5|^2.0",
"guzzlehttp/psr7": "^1.7|^2.0",
"illuminate/broadcasting": "^6.3|^7.0|^8.0",
"illuminate/console": "^6.3|^7.0|^8.0",
"illuminate/http": "^6.3|^7.0|^8.0",
"illuminate/queue": "^6.3|^7.0|^8.0",
"illuminate/routing": "^6.3|^7.0|^8.0",
"illuminate/support": "^6.3|^7.0|^8.0",
"pusher/pusher-php-server": "^3.0|^4.0|^5.0|^6.0|^7.0",
"react/promise": "^2.0",
"symfony/http-kernel": "^4.0|^5.0",
"react/promise": "^2.8",
"symfony/http-kernel": "^4.4|^5.4",
"symfony/psr-http-message-bridge": "^1.1|^2.0"
},
"require-dev": {
"clue/block-react": "^1.4",
"laravel/legacy-factories": "^1.1",
"orchestra/testbench-browser-kit": "^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.0|^9.0"
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"suggest": {
"ext-pcntl": "Running the server needs pcntl to listen to command signals and soft-shutdown.",
Expand Down
3 changes: 2 additions & 1 deletion src/API/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use BeyondCode\LaravelWebSockets\Contracts\ChannelManager;
use BeyondCode\LaravelWebSockets\Server\QueryParameters;
use Exception;
use GuzzleHttp\Psr7\Message;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\ServerRequest;
use Illuminate\Http\JsonResponse;
Expand Down Expand Up @@ -139,7 +140,7 @@ public function onError(ConnectionInterface $connection, Exception $exception)
'error' => $exception->getMessage(),
]));

tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close();
tap($connection)->send(Message::toString($response))->close();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Dashboard/Http/Controllers/SendMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use BeyondCode\LaravelWebSockets\Concerns\PushesToPusher;
use BeyondCode\LaravelWebSockets\Rules\AppId;
use Exception;
use Illuminate\Http\Request;
use Throwable;

class SendMessage
{
Expand Down Expand Up @@ -42,7 +42,7 @@ public function __invoke(Request $request)
$request->event,
$decodedData ?: []
);
} catch (Exception $e) {
} catch (Throwable $e) {
return response()->json([
'ok' => false,
'exception' => $e->getMessage(),
Expand Down
3 changes: 2 additions & 1 deletion src/Server/HealthHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace BeyondCode\LaravelWebSockets\Server;

use Exception;
use GuzzleHttp\Psr7\Message;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\RequestInterface;
use Ratchet\ConnectionInterface;
Expand All @@ -25,7 +26,7 @@ public function onOpen(ConnectionInterface $connection, RequestInterface $reques
json_encode(['ok' => true])
);

tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close();
tap($connection)->send(Message::toString($response))->close();
}

/**
Expand Down

0 comments on commit 491d164

Please sign in to comment.