public function testHostSocket() { $socketExists = file_exists('/tmp/redis.sock'); $this->skipIf(!$socketExists, 'Redis is not listening on socket'); $this->assertNotException('RedisException', function () { $redis = new Redis(array('host' => '/tmp/redis.sock')); $redis->info(); }); }
/** * Skip the test if the Redis extension is unavailable. * * @return void */ public function skip() { $extensionExists = extension_loaded('redis'); $message = 'The redis extension is not installed.'; $this->skipIf(!$extensionExists, $message); $R = new \Redis(); $R->connect('127.0.0.1', 6379); $message = 'redis-server does not appear to be running on 127.0.0.1:6379'; $result = $R->info(); $this->skipIf(empty($result), $message); unset($R); }