@@ -46,9 +46,9 @@ public function testFromDsnWithOptions()
46
46
'host ' => 'localhost ' ,
47
47
'port ' => 6379 ,
48
48
], [
49
- 'blocking_timeout ' => 30 ,
49
+ 'serializer ' => 2 ,
50
50
]),
51
- Connection::fromDsn ('redis://localhost/queue/group1/consumer1 ' , ['blocking_timeout ' => 30 ])
51
+ Connection::fromDsn ('redis://localhost/queue/group1/consumer1 ' , ['serializer ' => 2 ])
52
52
);
53
53
}
54
54
@@ -59,9 +59,9 @@ public function testFromDsnWithQueryOptions()
59
59
'host ' => 'localhost ' ,
60
60
'port ' => 6379 ,
61
61
], [
62
- 'blocking_timeout ' => 30 ,
62
+ 'serializer ' => 2 ,
63
63
]),
64
- Connection::fromDsn ('redis://localhost/queue/group1/consumer1?blocking_timeout=30 ' )
64
+ Connection::fromDsn ('redis://localhost/queue/group1/consumer1?serializer=2 ' )
65
65
);
66
66
}
67
67
@@ -134,16 +134,20 @@ public function testGetAfterReject()
134
134
$ redis ->del ('messenger-rejectthenget ' );
135
135
}
136
136
137
- public function testBlockingTimeout ()
137
+ public function testGetNonBlocking ()
138
138
{
139
139
$ redis = new \Redis ();
140
- $ connection = Connection::fromDsn ('redis://localhost/messenger-blockingtimeout ' , ['blocking_timeout ' => 1 ], $ redis );
140
+
141
+ $ connection = Connection::fromDsn ('redis://localhost/messenger-getnonblocking ' , [], $ redis );
141
142
try {
142
143
$ connection ->setup ();
143
144
} catch (TransportException $ e ) {
144
145
}
145
146
146
- $ this ->assertNull ($ connection ->get ());
147
- $ redis ->del ('messenger-blockingtimeout ' );
147
+ $ this ->assertNull ($ connection ->get ()); // no message, should return null immediately
148
+ $ connection ->add ('1 ' , []);
149
+ $ this ->assertNotEmpty ($ message = $ connection ->get ());
150
+ $ connection ->reject ($ message ['id ' ]);
151
+ $ redis ->del ('messenger-getnonblocking ' );
148
152
}
149
153
}
0 commit comments