mirror of
https://github.com/predis/predis.git
synced 2026-09-19 14:56:57 +00:00
Test suite: added HGET.
This commit is contained in:
@@ -1458,6 +1458,20 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
|
||||
});
|
||||
}
|
||||
|
||||
function testHashGet() {
|
||||
$this->assertTrue($this->redis->hset('metavars', 'foo', 'bar'));
|
||||
$this->assertEquals('bar', $this->redis->hget('metavars', 'foo'));
|
||||
|
||||
$this->assertEquals('bar', $this->redis->hget('metavars', 'foo'));
|
||||
$this->assertNull($this->redis->hget('metavars', 'hoge'));
|
||||
$this->assertNull($this->redis->hget('hashDoesNotExist', 'field'));
|
||||
|
||||
RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function($test) {
|
||||
$test->redis->rpush('metavars', 'foo');
|
||||
$test->redis->hget('metavars', 'foo');
|
||||
});
|
||||
}
|
||||
|
||||
/* multiple databases handling commands */
|
||||
|
||||
function testSelectDatabase() {
|
||||
|
||||
Reference in New Issue
Block a user