File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
src/Illuminate/Redis/Connections Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function flushdb()
1313 {
1414 $ arguments = func_get_args ();
1515
16- $ async = strtoupper ((string ) $ arguments [0 ] ?? null ) === 'ASYNC ' ;
16+ $ async = strtoupper ((string ) ( $ arguments [0 ] ?? null ) ) === 'ASYNC ' ;
1717
1818 foreach ($ this ->client ->_masters () as $ master ) {
1919 $ async
Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ public function flushdb()
500500 {
501501 $ arguments = func_get_args ();
502502
503- if (strtoupper ((string ) $ arguments [0 ] ?? null ) === 'ASYNC ' ) {
503+ if (strtoupper ((string ) ( $ arguments [0 ] ?? null ) ) === 'ASYNC ' ) {
504504 return $ this ->command ('flushdb ' , [true ]);
505505 }
506506
Original file line number Diff line number Diff line change @@ -467,6 +467,28 @@ public function testItGetsMultipleKeys()
467467 }
468468 }
469469
470+ public function testItFlushes ()
471+ {
472+ foreach ($ this ->connections () as $ redis ) {
473+ $ redis ->set ('name ' , 'Till ' );
474+ $ this ->assertSame (1 , $ redis ->exists ('name ' ));
475+
476+ $ redis ->flushdb ();
477+ $ this ->assertSame (0 , $ redis ->exists ('name ' ));
478+ }
479+ }
480+
481+ public function testItFlushesAsynchronous ()
482+ {
483+ foreach ($ this ->connections () as $ redis ) {
484+ $ redis ->set ('name ' , 'Till ' );
485+ $ this ->assertSame (1 , $ redis ->exists ('name ' ));
486+
487+ $ redis ->flushdb ('ASYNC ' );
488+ $ this ->assertSame (0 , $ redis ->exists ('name ' ));
489+ }
490+ }
491+
470492 public function testItRunsEval ()
471493 {
472494 foreach ($ this ->connections () as $ redis ) {
You can’t perform that action at this time.
0 commit comments