Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2020-03-03 09:13:33 +0300
committerMichael Grunder <michael.grunder@gmail.com>2022-09-29 09:18:53 +0300
commit98fda1b870171a800a587512bcc59c8bdbd0869a (patch)
tree724e97cb7e1886f1015c3d5ed7a55d5889a9105f /tests
parenta98605f216449479cf27599244c25cbf415ed226 (diff)
Make sure we set an error for key based scans
See #1661
Diffstat (limited to 'tests')
-rw-r--r--tests/RedisClusterTest.php1
-rw-r--r--tests/RedisTest.php11
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/RedisClusterTest.php b/tests/RedisClusterTest.php
index 6daa93bb..908e1e58 100644
--- a/tests/RedisClusterTest.php
+++ b/tests/RedisClusterTest.php
@@ -49,6 +49,7 @@ class Redis_Cluster_Test extends Redis_Test {
public function testTlsConnect() { return $this->markTestSkipped(); }
public function testReset() { return $this->markTestSkipped(); }
public function testInvalidAuthArgs() { return $this->markTestSkipped(); }
+ public function testScanErrors() { return $this->markTestSkipped(); }
public function testlMove() { return $this->markTestSkipped(); }
public function testlPos() { return $this->marktestSkipped(); }
diff --git a/tests/RedisTest.php b/tests/RedisTest.php
index 6ef56490..9c06b64e 100644
--- a/tests/RedisTest.php
+++ b/tests/RedisTest.php
@@ -5701,6 +5701,17 @@ class Redis_Test extends TestSuite
$this->assertEquals(0, $i_p_count);
}
+ /* Make sure we capture errors when scanning */
+ public function testScanErrors() {
+ $this->redis->set('scankey', 'simplekey');
+
+ foreach (['sScan', 'hScan', 'zScan'] as $str_method) {
+ $it = NULL;
+ $this->redis->$str_method('scankey', $it);
+ $this->assertTrue(strpos($this->redis->getLastError(), 'WRONGTYPE') === 0);
+ }
+ }
+
//
// HyperLogLog (PF) commands
//