From e2e809c9d4a97d37e0c915dcfee1e5dea30db5bc Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sat, 16 Feb 2013 11:46:42 +0100 Subject: [PATCH] Fix test to handle different hashes generated on 64bits builds of PHP. Just noticed it on Travis CI as they recently switched to 64bits PHP builds, also great to see that the library seems to work fine anyway. --- tests/Predis/Cluster/PredisClusterHashStrategyTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Predis/Cluster/PredisClusterHashStrategyTest.php b/tests/Predis/Cluster/PredisClusterHashStrategyTest.php index 0ff758ac..71d88e01 100644 --- a/tests/Predis/Cluster/PredisClusterHashStrategyTest.php +++ b/tests/Predis/Cluster/PredisClusterHashStrategyTest.php @@ -26,7 +26,9 @@ class PredisClusterHashStrategyTest extends StandardTestCase */ public function testSupportsKeyTags() { - $expected = -1938594527; + // NOTE: 32 and 64 bits PHP runtimes can produce different hash values. + $expected = PHP_INT_SIZE == 4 ? -1938594527 : 2356372769; + $strategy = $this->getHashStrategy(); $this->assertSame($expected, $strategy->getKeyHash('{foo}'));