File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
src/Symfony/Component/Messenger 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()
115
115
116
116
public function testGetAfterReject ()
117
117
{
118
- $ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' );
118
+ $ redis = new \Redis ();
119
+ $ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' , [], $ redis );
119
120
try {
120
121
$ connection ->setup ();
121
122
} catch (TransportException $ e ) {
@@ -129,5 +130,20 @@ public function testGetAfterReject()
129
130
130
131
$ connection = Connection::fromDsn ('redis://localhost/messenger-rejectthenget ' );
131
132
$ 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 ' );
132
148
}
133
149
}
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public function get(): ?array
102
102
return $ this ->get ();
103
103
}
104
104
105
- foreach ($ messages [$ this ->stream ] as $ key => $ message ) {
105
+ foreach ($ messages [$ this ->stream ] ?? [] as $ key => $ message ) {
106
106
$ redisEnvelope = \json_decode ($ message ['message ' ], true );
107
107
108
108
return [
You can’t perform that action at this time.
0 commit comments