trait RequiresAnyTagModeRedis

Skips tests when the environment doesn't support Redis any-mode tag operations.

Any-mode requires:

  • phpredis >= 6.3.0 (HSETEX command)
  • Redis >= 8.0.0 OR Valkey >= 9.0.0 (HEXPIRE command)

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

Constants

private PHPREDIS_MIN_VERSION

Minimum phpredis version required for any-mode (HSETEX support).

private REDIS_MIN_VERSION

Minimum Redis version required for any-mode (HEXPIRE support).

private VALKEY_MIN_VERSION

Minimum Valkey version required for any-mode (HEXPIRE support).

Methods

void
skipIfAnyTagModeUnsupported()

Skip the current test if any-mode tag 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.

Details

at line 51
protected void skipIfAnyTagModeUnsupported()

Skip the current test if any-mode tag requirements are not met.

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

Return Value

void

at line 100
protected string detectedPhpredisVersion()

Detect the installed phpredis version. Overridable for tests.

Return Value

string

at line 110
protected array detectedServerInfo()

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

Return Value

array