Skip to content

Commit

Permalink
Ensure scan() works with phpredis + logging: true
Browse files Browse the repository at this point in the history
Rel: #714
  • Loading branch information
ostrolucky committed Dec 16, 2023
1 parent 0ffe9e7 commit 75ce190
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
src = pkgs.fetchFromGitHub {
repo = "phpredis";
owner = "phpredis";
rev = "2bddd84f2f653ee3e956a4683f9938787905f72d";
sha256 = "sha256-quKibCW9bMselVNWdu4ZfdZ+dcDYmQxBnKVCHwYpRJA=";
rev = "ff305349dba87ab857a8f28acbc3b22af5a271cc";
sha256 = "sha256-vTuUoYATt2NEtkpztaHMEFVWvv9oEnJ5/ZI+FAbjqWo=";
};
}))
# relay section https://relay.so/docs/1.x/installation#manual-installation
Expand Down
8 changes: 8 additions & 0 deletions tests/Factory/PhpredisClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

use function class_exists;
use function fsockopen;
use function phpversion;
use function sprintf;
use function version_compare;

class PhpredisClientFactoryTest extends TestCase
{
Expand Down Expand Up @@ -338,6 +340,8 @@ public function testMethodWithPassByRefArgument(): void
['Executing command "AUTH sncredis"'],
['Executing command "SELECT 2"'],
['Executing command "SSCAN set 1 <null> 0"'],
['Executing command "SET mykey myvalue <null>"'],
['Executing command "SCAN <null> <null> ' . (version_compare(phpversion('redis'), '6', '<') ? '' : '0 ') . '<null>"'],
);

$factory = new PhpredisClientFactory(new RedisCallInterceptor($this->redisLogger));
Expand All @@ -355,5 +359,9 @@ public function testMethodWithPassByRefArgument(): void
$client->sscan('set', $iterator, null, 0);

$this->assertSame(0, $iterator);

$client->set('mykey', 'myvalue');
/** @psalm-suppress TooFewArguments */
$this->assertSame(['mykey'], $client->scan($iterator2));
}
}

0 comments on commit 75ce190

Please sign in to comment.