diff options
author | michael-grunder <michael.grunder@gmail.com> | 2013-04-28 22:10:32 +0400 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2013-04-28 22:10:32 +0400 |
commit | f9f2dc0dbf02394ef221b3b1ef8fc67a73b722de (patch) | |
tree | 2d53c95d37a9e7af92b7de0482906f4a4fd46e5d /tests/TestRedis.php | |
parent | 4c16a303efdde3d3c41d8f6c44a24cec2d45ae22 (diff) | |
parent | 3e6d5b60d66e0a5b31080a7109c412b0ce6358e6 (diff) |
Merge branch 'release/2.2.3'2.2.3
Diffstat (limited to 'tests/TestRedis.php')
-rw-r--r-- | tests/TestRedis.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/TestRedis.php b/tests/TestRedis.php index db9099ba..20fdb358 100644 --- a/tests/TestRedis.php +++ b/tests/TestRedis.php @@ -1650,6 +1650,32 @@ class Redis_Test extends TestSuite $this->assertTrue(FALSE === $this->redis->persist('x')); // false if the key doesn’t exist. } + public function testClient() { + /* CLIENT SETNAME */ + $this->assertTrue($this->redis->client('setname', 'phpredis_unit_tests')); + + /* CLIENT LIST */ + $arr_clients = $this->redis->client('list'); + $this->assertTrue(is_array($arr_clients)); + + // Figure out which ip:port is us! + $str_addr = NULL; + foreach($arr_clients as $arr_client) { + if($arr_client['name'] == 'phpredis_unit_tests') { + $str_addr = $arr_client['addr']; + } + } + + // We should have found our connection + $this->assertFalse(empty($str_addr)); + + /* CLIENT GETNAME */ + $this->assertTrue($this->redis->client('getname'), 'phpredis_unit_tests'); + + /* CLIENT KILL -- phpredis will reconnect, so we can do this */ + $this->assertTrue($this->redis->client('kill', $str_addr)); + } + public function testinfo() { $info = $this->redis->info(); |