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

[5.7] Fix Redis::mget() call, arg should be an array #26710 #26716

Merged
merged 3 commits into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Redis/Connections/PhpRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function mget(array $keys)
{
return array_map(function ($value) {
return $value !== false ? $value : null;
}, $this->command('mget', $keys));
}, $this->command('mget', [$keys]));
}

/**
Expand Down
16 changes: 16 additions & 0 deletions tests/Redis/RedisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,22 @@ public function test_it_gets_multiple_hash_fields()
}
}

public function test_it_gets_multiple_keys()
{
$valueSet = ['name' => 'mohamed', 'hobby' => 'diving'];

foreach ($this->connections() as $redis) {
$redis->mset($valueSet);

$this->assertEquals(
array_values($valueSet),
$redis->mget(array_keys($valueSet))
);

$redis->flushall();
}
}

public function test_it_runs_eval()
{
foreach ($this->connections() as $redis) {
Expand Down