File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ public function testUnexpectedRedisError()
115115
116116 public function testGetAfterReject ()
117117 {
118- $ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' );
118+ $ redis = new \Redis ();
119+ $ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' , [], $ redis );
119120 try {
120121 $ connection ->setup ();
121122 } catch (TransportException $ e ) {
@@ -129,5 +130,20 @@ public function testGetAfterReject()
129130
130131 $ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' );
131132 $ this ->assertNotNull ($ connection ->get ());
133+
134+ $ redis ->del ('messenger-rejectthenget ' );
135+ }
136+
137+ public function testBlockingTimeout ()
138+ {
139+ $ redis = new \Redis ();
140+ $ connection = Connection::fromDsn ('redis://localhost/messenger-blockingtimeout ' , ['blocking_timeout ' => 1 ], $ redis );
141+ try {
142+ $ connection ->setup ();
143+ } catch (TransportException $ e ) {
144+ }
145+
146+ $ this ->assertNull ($ connection ->get ());
147+ $ redis ->del ('messenger-blockingtimeout ' );
132148 }
133149}
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public function get(): ?array
102102 return $ this ->get ();
103103 }
104104
105- foreach ($ messages [$ this ->stream ] as $ key => $ message ) {
105+ foreach ($ messages [$ this ->stream ] ?? [] as $ key => $ message ) {
106106 $ redisEnvelope = \json_decode ($ message ['message ' ], true );
107107
108108 return [
You can’t perform that action at this time.
0 commit comments