Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Storage/PresenceChannelUsersRedisRepository.php
  • Loading branch information
slavarazum committed Dec 3, 2023
2 parents e8407db + fa9d4bc commit 92acf70
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/Events/SomePresenceEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class SomePresenceEvent implements ShouldBroadcast
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
use Dispatchable;

public $someData = [
'name' => 'presence',
Expand Down
2 changes: 1 addition & 1 deletion tests/Events/SomePrivateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class SomePrivateEvent implements ShouldBroadcast
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
use Dispatchable;

public $name = 'private';

Expand Down
7 changes: 4 additions & 3 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\ReflectsClosures;
use function PHPUnit\Framework\assertCount;
use function PHPUnit\Framework\assertSame;
use function PHPUnit\Framework\assertTrue;
use Qruto\LaravelWave\Tests\RedisConnectionMock;
use Qruto\LaravelWave\Tests\Support\User;
use Qruto\LaravelWave\Tests\TestCase;

use function PHPUnit\Framework\assertCount;
use function PHPUnit\Framework\assertSame;
use function PHPUnit\Framework\assertTrue;

uses(TestCase::class)->in(__DIR__);

uses()->beforeEach(function () {
Expand Down
3 changes: 2 additions & 1 deletion tests/PresenceChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Redis;
use function Pest\Laravel\actingAs;
use Qruto\LaravelWave\Events\PresenceChannelJoinEvent;
use Qruto\LaravelWave\Events\SseConnectionClosedEvent;
use Qruto\LaravelWave\Tests\Events\SomePresenceEvent;
use Qruto\LaravelWave\Tests\Events\SomePrivateEvent;
use Qruto\LaravelWave\Tests\Support\User;

use function Pest\Laravel\actingAs;

it('send join event on join request', function () {
Event::fake([PresenceChannelJoinEvent::class]);

Expand Down
10 changes: 5 additions & 5 deletions tests/PresenceChannelUsersRedisRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function userChannelsKey(Authenticatable $user): string
))->toBe(true);
});

it('successfully saves second user connection', function () use ($connectionId, $channel) {
it('successfully saves second user connection', function () {
Redis::shouldReceive('hexists')->once()->withArgs([
'laravel_database_channels:community:users',
$this->user->getAuthIdentifierForBroadcasting(),
Expand Down Expand Up @@ -184,10 +184,10 @@ function userChannelsKey(Authenticatable $user): string
$removedConnections = $this->repository->removeConnection($this->user, $connectionId);

expect($removedConnections)->toEqual([
// [
// 'channel' => 'channel1',
// 'user_info' => ['email' => '[email protected]'],
// ],
// [
// 'channel' => 'channel1',
// 'user_info' => ['email' => '[email protected]'],
// ],
[
'channel' => 'channel2',
'user_info' => ['email' => '[email protected]'],
Expand Down
3 changes: 2 additions & 1 deletion tests/WhisperTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Illuminate\Support\Facades\Event;
use function Pest\Laravel\post;
use Qruto\LaravelWave\Events\ClientEvent;
use Qruto\LaravelWave\Tests\Support\User;

use function Pest\Laravel\post;

it('successfully send whisper event', function () {
Event::fake([ClientEvent::class]);

Expand Down

0 comments on commit 92acf70

Please sign in to comment.