From ff004aeaaa5ca02a84e04cc99e0f88b242152b7f Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Wed, 6 Nov 2013 16:37:12 +0100 Subject: [PATCH] Reenable skipped tests since bug in Redis has been fixed. See commit antirez/redis@54a5a7dff8832a59575c45c7bbbb4ea5a77cd000 --- tests/Predis/Command/HashScanTest.php | 2 -- tests/Predis/Command/ZSetScanTest.php | 12 +++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/Predis/Command/HashScanTest.php b/tests/Predis/Command/HashScanTest.php index 22b9d761..1ddefd62 100644 --- a/tests/Predis/Command/HashScanTest.php +++ b/tests/Predis/Command/HashScanTest.php @@ -138,8 +138,6 @@ class HashScanTest extends CommandTestCase */ public function testScanWithMatchingMembers() { - $this->markTestSkipped('This test currently makes Redis crash.'); - $redis = $this->getClient(); $redis->hmset('key', array('field:one' => 'one', 'field:two' => 'two', 'field:three' => 'three', 'field:four' => 'four')); diff --git a/tests/Predis/Command/ZSetScanTest.php b/tests/Predis/Command/ZSetScanTest.php index a227c162..918afe14 100644 --- a/tests/Predis/Command/ZSetScanTest.php +++ b/tests/Predis/Command/ZSetScanTest.php @@ -138,15 +138,13 @@ class ZSetScanTest extends CommandTestCase */ public function testScanWithMatchingMembers() { - $this->markTestSkipped('This test currently makes Redis crash.'); - $redis = $this->getClient(); - $redis->hmset('key', array('member:one' => 1, 'member:two' => 2, 'member:three' => 3, 'member:four' => 4)); + $redis->zadd('key', array('member:one' => 1.0, 'member:two' => 2.0, 'member:three' => 3.0, 'member:four' => 4.0)); - $response = $redis->hscan('key', 0, 'MATCH', 'member:t*'); + $response = $redis->zscan('key', 0, 'MATCH', 'member:t*'); - $this->assertSame(array('member:two', 'member:three'), array_keys($response[1])); - $this->assertSame(array(2.0, 3.0), array_values($response[1])); + $this->assertSame(array('member:two', 'member:three'), array_map(function($e) { return $e[0]; }, $response[1])); + $this->assertSame(array(2.0, 3.0), array_map(function($e) { return $e[1]; }, $response[1])); } /** @@ -155,7 +153,7 @@ class ZSetScanTest extends CommandTestCase public function testScanWithNoMatchingMembers() { $redis = $this->getClient(); - $redis->zadd('key', $members = array('member:one' => 1, 'member:two' => 2, 'member:three' => 3, 'member:four' => 4)); + $redis->zadd('key', $members = array('member:one' => 1.0, 'member:two' => 2.0, 'member:three' => 3.0, 'member:four' => 4.0)); $response = $redis->zscan('key', 0, 'MATCH', 'nomember:*');