KeyKeysV12xTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis\Command;
  11. /**
  12. * We only perform disconnected tests for this commands because
  13. * it is too old (Redis v1.2) and expects a different response
  14. * format.
  15. *
  16. * @group commands
  17. * @group realm-key
  18. */
  19. class KeyKeysV12xTest extends PredisCommandTestCase
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. protected function getExpectedCommand()
  25. {
  26. return 'Predis\Command\KeyKeysV12x';
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. protected function getExpectedId()
  32. {
  33. return 'KEYS';
  34. }
  35. /**
  36. * @group disconnected
  37. */
  38. public function testFilterArguments()
  39. {
  40. $arguments = array('pattern:*');
  41. $expected = array('pattern:*');
  42. $command = $this->getCommand();
  43. $command->setArguments($arguments);
  44. $this->assertSame($expected, $command->getArguments());
  45. }
  46. /**
  47. * @group disconnected
  48. */
  49. public function testParseResponse()
  50. {
  51. $raw = 'key1 key2 key3';
  52. $parsed = array('key1', 'key2', 'key3');
  53. $this->assertSame($parsed, $this->getCommand()->parseResponse($raw));
  54. }
  55. }