12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace Predis\Command;
- class HashValuesTest extends PredisCommandTestCase
- {
-
- protected function getExpectedCommand()
- {
- return 'Predis\Command\HashValues';
- }
-
- protected function getExpectedId()
- {
- return 'HVALS';
- }
-
- public function testFilterArguments()
- {
- $arguments = array('key');
- $expected = array('key');
- $command = $this->getCommand();
- $command->setArguments($arguments);
- $this->assertSame($expected, $command->getArguments());
- }
-
- public function testParseResponse()
- {
- $raw = array('foo', 'hoge', 'lol');
- $expected = array('foo', 'hoge', 'lol');
- $command = $this->getCommand();
- $this->assertSame($expected, $command->parseResponse($raw));
- }
-
- public function testReturnsValuesOfHash()
- {
- $redis = $this->getClient();
- $redis->hmset('metavars', 'foo', 'bar', 'hoge', 'piyo', 'lol', 'wut');
- $this->assertSame(array('bar', 'piyo', 'wut'), $redis->hvals('metavars'));
- $this->assertSame(array(), $redis->hvals('unknown'));
- }
-
- public function testThrowsExceptionOnWrongType()
- {
- $redis = $this->getClient();
- $redis->set('foo', 'bar');
- $redis->hvals('foo');
- }
- }
|