소스 검색

Add methods to test for uppercase and lowercase commands

At this moment predis is only capable of lowercase commands, the test
adds the requirement to provide both lowercase, uppercase (and even
mixed case) commands.
Jurian Sluiman 13 년 전
부모
커밋
07584f859c
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      test/RedisCommandsTest.php

+ 14 - 0
test/RedisCommandsTest.php

@@ -2075,5 +2075,19 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
     function testLastSave() {
         $this->assertGreaterThan(0, $this->redis->lastsave());
     }
+
+    function testUppercaseCommands() {
+        $uppercase = $this->redis->INFO();
+        $lowercase = $this->redis->info();
+        $this->assertEquals($uppercase, $lowercase);
+
+        $uppercase = $this->getProfile()->supportsCommand('INFO');
+        $lowercase = $this->getProfile()->supportsCommand('info');
+        $this->assertEquals($uppercase, $lowercase);
+
+        $uppercase = $this->getProfile()->createCommand('INFO');
+        $lowercase = $this->getProfile()->createCommand('info');
+        $this->assertEquals($uppercase, $lowercase);
+    }
 }
 ?>