Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Adds missing options for PhpRedis #31182

Merged
merged 12 commits into from
Jan 21, 2020
Prev Previous commit
Next Next commit
Fixed tests
  • Loading branch information
Wizofgoz committed Jan 21, 2020
commit b83d10dd8d8535a5c1b6b1268c5bbec1c785d7be
10 changes: 6 additions & 4 deletions tests/Redis/RedisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,10 @@ public function testItScansForKeys()
do {
[$cursor, $returnedKeys] = $redis->scan($iterator);

if (!is_array($returnedKeys)) {
$returnedKeys = [$returnedKeys];
}

foreach ($returnedKeys as $returnedKey) {
$this->assertTrue(in_array($returnedKey, $initialKeys));
}
Expand All @@ -583,12 +587,10 @@ public function testPhpRedisScanOption()
$iterator = null;

do {
[$cursor, $returnedKeys] = $redis->scan($iterator);
$returned = $redis->scan($iterator);

if ($redis->client()->getOption(Redis::OPT_SCAN) === Redis::SCAN_RETRY) {
$this->assertNotFalse($returnedKeys);
} else {
$this->assertFalse($returnedKeys);
$this->assertEmpty($returned);
}
} while ($iterator > 0);
}
Expand Down