44
55use BeyondCode \LaravelWebSockets \Tests \Mocks \Message ;
66use BeyondCode \LaravelWebSockets \Tests \TestCase ;
7- use Illuminate \Support \Facades \Cache ;
7+ use Illuminate \Support \Facades \Redis ;
88
99class PresenceChannelReplicationTest extends TestCase
1010{
11- /**
12- * The Redis manager instance.
13- *
14- * @var \Illuminate\Redis\RedisManager
15- */
16- protected $ redis ;
17-
1811 /**
1912 * {@inheritdoc}
2013 */
@@ -23,8 +16,6 @@ public function setUp(): void
2316 parent ::setUp ();
2417
2518 $ this ->runOnlyOnRedisReplication ();
26-
27- $ this ->redis = Cache::getRedis ();
2819 }
2920
3021 /** @test */
@@ -55,7 +46,7 @@ public function clients_with_valid_auth_signatures_can_join_presence_channels()
5546 $ this ->pusherServer ->onMessage ($ connection , $ message );
5647
5748 $ this ->getPublishClient ()
58- ->assertNotCalledWithArgs ('hset ' , [
49+ ->assertCalledWithArgs ('hset ' , [
5950 'laravel_database_1234:presence-channel ' ,
6051 $ connection ->socketId ,
6152 json_encode ($ channelData ),
@@ -64,7 +55,7 @@ public function clients_with_valid_auth_signatures_can_join_presence_channels()
6455 ->assertCalled ('publish ' );
6556
6657 $ this ->assertNotNull (
67- $ this -> redis -> hget ('laravel_database_1234:presence-channel ' , $ connection ->socketId )
58+ Redis:: hget ('laravel_database_1234:presence-channel ' , $ connection ->socketId )
6859 );
6960 }
7061
@@ -96,7 +87,7 @@ public function clients_with_valid_auth_signatures_can_leave_presence_channels()
9687 ->assertEventDispatched ('message ' );
9788
9889 $ this ->getPublishClient ()
99- ->assertNotCalled ('hset ' )
90+ ->assertCalled ('hset ' )
10091 ->assertCalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
10192 ->assertCalled ('publish ' );
10293
@@ -114,7 +105,7 @@ public function clients_with_valid_auth_signatures_can_leave_presence_channels()
114105 $ this ->pusherServer ->onMessage ($ connection , $ message );
115106
116107 $ this ->getPublishClient ()
117- ->assertNotCalled ('hdel ' )
108+ ->assertCalled ('hdel ' )
118109 ->assertCalled ('publish ' );
119110 }
120111
@@ -143,8 +134,8 @@ public function clients_with_no_user_info_can_join_presence_channels()
143134 $ this ->pusherServer ->onMessage ($ connection , $ message );
144135
145136 $ this ->getPublishClient ()
146- ->assertNotCalled ('hset ' )
147- ->assertcalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
137+ ->assertCalled ('hset ' )
138+ ->assertCalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
148139 ->assertCalled ('publish ' );
149140 }
150141}
0 commit comments