Fixes for Redis extension and associated test suite
Summary: * Fix a couple of tests that were broken by
91b1918 adding two lines to the
wrong expect file (list.php.expect instead of info.php.expect).
* Fixed hphp/test/slow/ext_redis/watch.php.expect to expect the correct
behavior. (Tested by verifying with Zend + phpredis.)
* Make the key prefix set by the test suite include the md5 of the file path
plus UNIX timestamp representing the test suite initialization. This makes
the tests not break when the path exceeds the redis key length limit and it
makes repeated test runs not conflict with one another.
* Make Redis::sRandMember apply the key prefix (if one exists).
* Make Redis::get() and Redis::h{m}get() return false rather than null for
missing keys or fields, matching the behavior of phpredis.
Minimal test case for the false / null behavior:
<?php
$redis = new Redis;
$redis->connect("localhost");
var_dump($redis->get("nonexistent-key"));
$redis->hMset('ice_cream', array('flavor' => 'vanilla'));
var_dump($redi
Closes https://github.com/facebook/hhvm/pull/3318
Reviewed By: bsimmers, ptarjan
Differential Revision:
D1467674
Pulled By: svcscm