File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,26 @@ public function testTime() {
154154 }
155155
156156 public function testScan () {
157- $ this ->markTestSkipped (); // this will be implemented
157+ $ i_key_count = 0 ;
158+ $ i_scan_count = 0 ;
159+
160+ /* Have scan retry for us */
161+ $ this ->redis ->setOption (Redis::OPT_SCAN , Redis::SCAN_RETRY );
162+
163+ /* Iterate over our masters, scanning each one */
164+ foreach ($ this ->redis ->_masters () as $ arr_master ) {
165+ /* Grab the number of keys we have */
166+ $ i_key_count += $ this ->redis ->dbsize ($ arr_master );
167+
168+ /* Scan the keys here */
169+ $ it = NULL ;
170+ while ($ arr_keys = $ this ->redis ->scan ($ it , $ arr_master )) {
171+ $ i_scan_count += count ($ arr_keys );
172+ }
173+ }
174+
175+ /* Our total key count should match */
176+ $ this ->assertEquals ($ i_scan_count , $ i_key_count );
158177 }
159178
160179 // Run some simple tests against the PUBSUB command. This is problematic, as we
You can’t perform that action at this time.
0 commit comments