mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
@@ -40,6 +40,7 @@ zend_function_entry redis_sentinel_functions[] = {
|
||||
PHP_ME(RedisSentinel, getMasterAddrByName, arginfo_value, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, master, arginfo_value, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, masters, arginfo_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, myid, arginfo_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, ping, arginfo_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, reset, arginfo_value, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(RedisSentinel, sentinels, arginfo_value, ZEND_ACC_PUBLIC)
|
||||
@@ -132,6 +133,11 @@ PHP_METHOD(RedisSentinel, masters)
|
||||
REDIS_PROCESS_KW_CMD("masters", redis_sentinel_cmd, sentinel_mbulk_reply_zipped_assoc);
|
||||
}
|
||||
|
||||
PHP_METHOD(RedisSentinel, myid)
|
||||
{
|
||||
REDIS_PROCESS_KW_CMD("myid", redis_sentinel_cmd, redis_string_response);
|
||||
}
|
||||
|
||||
PHP_METHOD(RedisSentinel, ping)
|
||||
{
|
||||
REDIS_PROCESS_KW_CMD("PING", redis_empty_cmd, redis_boolean_response);
|
||||
|
||||
@@ -12,6 +12,7 @@ PHP_METHOD(RedisSentinel, flushconfig);
|
||||
PHP_METHOD(RedisSentinel, getMasterAddrByName);
|
||||
PHP_METHOD(RedisSentinel, master);
|
||||
PHP_METHOD(RedisSentinel, masters);
|
||||
PHP_METHOD(RedisSentinel, myid);
|
||||
PHP_METHOD(RedisSentinel, ping);
|
||||
PHP_METHOD(RedisSentinel, reset);
|
||||
PHP_METHOD(RedisSentinel, sentinels);
|
||||
|
||||
@@ -83,6 +83,17 @@ class Redis_Sentinel_Test extends TestSuite
|
||||
}
|
||||
}
|
||||
|
||||
public function testMyid()
|
||||
{
|
||||
// Only available since 6.2.0
|
||||
if (version_compare($this->version, '6.2.0') < 0) {
|
||||
$this->markTestSkipped();
|
||||
return;
|
||||
}
|
||||
$result = $this->sentinel->myid();
|
||||
$this->assertTrue(is_string($result));
|
||||
}
|
||||
|
||||
public function testPing()
|
||||
{
|
||||
$this->assertTrue($this->sentinel->ping());
|
||||
|
||||
Reference in New Issue
Block a user