@@ -46,9 +46,9 @@ public function testFromDsnWithOptions()
4646 'host ' => 'localhost ' ,
4747 'port ' => 6379 ,
4848 ], [
49- 'blocking_timeout ' => 30 ,
49+ 'serializer ' => 2 ,
5050 ]),
51- Connection::fromDsn ('redis://localhost/queue/group1/consumer1 ' , ['blocking_timeout ' => 30 ])
51+ Connection::fromDsn ('redis://localhost/queue/group1/consumer1 ' , ['serializer ' => 2 ])
5252 );
5353 }
5454
@@ -59,9 +59,9 @@ public function testFromDsnWithQueryOptions()
5959 'host ' => 'localhost ' ,
6060 'port ' => 6379 ,
6161 ], [
62- 'blocking_timeout ' => 30 ,
62+ 'serializer ' => 2 ,
6363 ]),
64- Connection::fromDsn ('redis://localhost/queue/group1/consumer1?blocking_timeout=30 ' )
64+ Connection::fromDsn ('redis://localhost/queue/group1/consumer1?serializer=2 ' )
6565 );
6666 }
6767
@@ -134,16 +134,20 @@ public function testGetAfterReject()
134134 $ redis ->del ('messenger-rejectthenget ' );
135135 }
136136
137- public function testBlockingTimeout ()
137+ public function testGetNonBlocking ()
138138 {
139139 $ 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 );
141142 try {
142143 $ connection ->setup ();
143144 } catch (TransportException $ e ) {
144145 }
145146
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 ' );
148152 }
149153}
0 commit comments