trait RequiresHashFieldExpiration

Skips tests when the environment doesn't support Redis hash field expiration.

Expects InteractsWithRedis on the same class — uses redisClient() to probe the server version. The support check is memoized per process.

Methods

void
skipIfHashFieldExpirationUnsupported()

Skip the current test if hash field expiration requirements are not met.

string
detectedPhpredisVersion()

Detect the installed phpredis version. Overridable for tests.

array
detectedServerInfo()

Detect the Redis/Valkey server info. Overridable for tests.

static void
flushHashFieldExpirationState()

Flush the memoized hash field expiration support check.

Details

at line 35
protected void skipIfHashFieldExpirationUnsupported()

Skip the current test if hash field expiration requirements are not met.

The check runs once per process and is then cached for all subsequent calls.

Return Value

void

at line 62
protected string detectedPhpredisVersion()

Detect the installed phpredis version. Overridable for tests.

Return Value

string

at line 72
protected array detectedServerInfo()

Detect the Redis/Valkey server info. Overridable for tests.

Return Value

array

at line 82
static void flushHashFieldExpirationState()

Flush the memoized hash field expiration support check.

Resets the capability result shared by tests in this class.

Return Value

void