File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
tests/Predis/Command/Redis Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,16 @@ public function getId()
2929
3030 public function setArguments (array $ arguments )
3131 {
32+ foreach ($ arguments as $ index => $ value ) {
33+ if ($ index < 2 ) {
34+ continue ;
35+ }
36+
37+ if (false === $ value || null === $ value ) {
38+ unset($ arguments [$ index ]);
39+ }
40+ }
41+
3242 parent ::setArguments ($ arguments );
33- $ this ->filterArguments ();
3443 }
3544}
Original file line number Diff line number Diff line change @@ -188,6 +188,32 @@ public function testSetStringDoesNotFailWithExplicitlySetNullArguments(): void
188188 );
189189 }
190190
191+ /**
192+ * @group connected
193+ * @requiresRedisVersion >= 2.6.12
194+ */
195+ public function testSetNull (): void
196+ {
197+ $ redis = $ this ->getClient ();
198+
199+ $ this ->assertEquals (
200+ 'OK ' , $ redis ->set ('foo ' , null )
201+ );
202+ }
203+
204+ /**
205+ * @group connected
206+ * @requiresRedisVersion >= 2.6.12
207+ */
208+ public function testSetFalse (): void
209+ {
210+ $ redis = $ this ->getClient ();
211+
212+ $ this ->assertEquals (
213+ 'OK ' , $ redis ->set ('foo ' , false )
214+ );
215+ }
216+
191217 /**
192218 * @group connected
193219 * @group cluster
You can’t perform that action at this time.
0 commit comments