4
4
5
5
use BeyondCode \LaravelWebSockets \Tests \Mocks \Message ;
6
6
use BeyondCode \LaravelWebSockets \Tests \TestCase ;
7
- use Illuminate \Support \Facades \Cache ;
7
+ use Illuminate \Support \Facades \Redis ;
8
8
9
9
class PresenceChannelReplicationTest extends TestCase
10
10
{
11
- /**
12
- * The Redis manager instance.
13
- *
14
- * @var \Illuminate\Redis\RedisManager
15
- */
16
- protected $ redis ;
17
-
18
11
/**
19
12
* {@inheritdoc}
20
13
*/
@@ -23,8 +16,6 @@ public function setUp(): void
23
16
parent ::setUp ();
24
17
25
18
$ this ->runOnlyOnRedisReplication ();
26
-
27
- $ this ->redis = Cache::getRedis ();
28
19
}
29
20
30
21
/** @test */
@@ -55,7 +46,7 @@ public function clients_with_valid_auth_signatures_can_join_presence_channels()
55
46
$ this ->pusherServer ->onMessage ($ connection , $ message );
56
47
57
48
$ this ->getPublishClient ()
58
- ->assertNotCalledWithArgs ('hset ' , [
49
+ ->assertCalledWithArgs ('hset ' , [
59
50
'laravel_database_1234:presence-channel ' ,
60
51
$ connection ->socketId ,
61
52
json_encode ($ channelData ),
@@ -64,7 +55,7 @@ public function clients_with_valid_auth_signatures_can_join_presence_channels()
64
55
->assertCalled ('publish ' );
65
56
66
57
$ this ->assertNotNull (
67
- $ this -> redis -> hget ('laravel_database_1234:presence-channel ' , $ connection ->socketId )
58
+ Redis:: hget ('laravel_database_1234:presence-channel ' , $ connection ->socketId )
68
59
);
69
60
}
70
61
@@ -96,7 +87,7 @@ public function clients_with_valid_auth_signatures_can_leave_presence_channels()
96
87
->assertEventDispatched ('message ' );
97
88
98
89
$ this ->getPublishClient ()
99
- ->assertNotCalled ('hset ' )
90
+ ->assertCalled ('hset ' )
100
91
->assertCalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
101
92
->assertCalled ('publish ' );
102
93
@@ -114,7 +105,7 @@ public function clients_with_valid_auth_signatures_can_leave_presence_channels()
114
105
$ this ->pusherServer ->onMessage ($ connection , $ message );
115
106
116
107
$ this ->getPublishClient ()
117
- ->assertNotCalled ('hdel ' )
108
+ ->assertCalled ('hdel ' )
118
109
->assertCalled ('publish ' );
119
110
}
120
111
@@ -143,8 +134,8 @@ public function clients_with_no_user_info_can_join_presence_channels()
143
134
$ this ->pusherServer ->onMessage ($ connection , $ message );
144
135
145
136
$ this ->getPublishClient ()
146
- ->assertNotCalled ('hset ' )
147
- ->assertcalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
137
+ ->assertCalled ('hset ' )
138
+ ->assertCalledWithArgs ('hgetall ' , ['laravel_database_1234:presence-channel ' ])
148
139
->assertCalled ('publish ' );
149
140
}
150
141
}
0 commit comments