Skip to content

Commit 2085c3f

Browse files
committed
Added testing.
1 parent 5b55bb2 commit 2085c3f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Pool/PoolFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use Hyperf\Di\Container;
1616
use Psr\Container\ContainerInterface;
17-
use Swoole\Coroutine\Channel;
1817

1918
class PoolFactory
2019
{

tests/RedisProxyTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ public function testRedisOptionSerializer()
6565
$this->assertSame('s:3:"yyy";', $this->getRedis()->get('test'));
6666
}
6767

68+
public function testRedisScan()
69+
{
70+
$redis = $this->getRedis();
71+
$origin = ['scan:1', 'scan:2', 'scan:3', 'scan:4'];
72+
foreach ($origin as $value) {
73+
$redis->set($value, '1');
74+
}
75+
76+
$it = null;
77+
$result = [];
78+
while (false !== $res = $redis->scan($it, 'scan:*', 2)) {
79+
$result = array_merge($result, $res);
80+
}
81+
82+
sort($result);
83+
84+
$this->assertEquals($origin, $result);
85+
$this->assertSame(0, $it);
86+
}
87+
6888
/**
6989
* @param mixed $optinos
7090
* @return \Redis

0 commit comments

Comments
 (0)