From 825490f490656533c3c435a8d0f60a51d6b04c86 Mon Sep 17 00:00:00 2001 From: Julia Date: Wed, 30 Jul 2014 09:34:37 -0700 Subject: [PATCH] Additional unit test for HMGET --- tests/units/RedisMock.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/units/RedisMock.php b/tests/units/RedisMock.php index 7682361..6b62174 100644 --- a/tests/units/RedisMock.php +++ b/tests/units/RedisMock.php @@ -1035,13 +1035,26 @@ public function testHSetHMSetHGetHDelHExistsHGetAll() ->isEqualTo(1); sleep(2); $this->assert + ->array($redisMock->hgetall('test')) + ->isEmpty() + ->string($redisMock->hmset('test', array( + 'test1' => 'somthing', + 'raoul' => 'nothing', + ))) ->array($redisMock->hmget('test', array('raoul', 'test1'))) ->isEqualTo(array( - 'raoul' => null, - 'test1' => null, + 'raoul' => 'nothing', + 'test1' => 'somthing', )) - ->array($redisMock->hgetall('test')) - ->isEmpty(); + ->integer($redisMock->expire('test', 1)) + ->isEqualTo(1); + sleep(2); + $this->assert + ->array($redisMock->hmget('test', array('raoul', 'test1'))) + ->isEqualTo(array( + 'raoul' => null, + 'test1' => null, + )); } public function testLPushRPushLRemLTrim()