This probably isn't a very common scenerio since we've never had someone
ask it in a decade, but it was very simple to get them working.
Primarily we just needed to test for `STDTOUT`/`STDERR` and use
`__DIR__` instead of `$_SERVER['PHP_SELF']`.
Fixes#2507
* Switch remaining old-style PHP 5.4 `Array(...)` declarations to `[...]`
* Update variable names getting rid hungarian notation prefixes (e.g.
`str_`, `i_`, etc).
* Allow cluster seeds to be passed on the command-line instead of soley
relying on either a node environment variable or our
tests/nodes/nodemap file. This should make it easier to run ad-hoc
cluster tests by specifying just a single seed.
* Add some diagnostics for when we can't find a suitable cluster to run
our tests against indicating exactly where we looked for the env var
and node file.
* Refactor RedisArray tests to use our newer TestSuite assertions.
* Allow `RedisArray` ports to be specified on the command-line as well.
* Various formatting fixes.
* More robust KeyDB detection.
* Tighten up `assertTrue` and `assertFalse` such that they test that
passed arguments `===` `true` and `===` `false` respectively, instead
of testing for truth-like or false-like.
* Start modernizing our unit tests to use explicit types for arguments,
return types, member variables, etc.
* Multiple assertion fixes that were exposed when making `assertTrue`
and `assertFalse` more explicit.
* Some formatting cleanup to style for incorrect indentation, etc, that
had crept in over many years.
* Add some more assertion helpers like `assertNull`, `assertGT`,
`assertGTE`, `assertLT`, and `assertLTE`.
Add a mechanism that allows users to specify an arbitrary class name, in
combination with a search path so that PhpRedis unit tests can be run
against a different client.
Additionally, this commit allows multiple classes to be invoked in one
test execution either by passing multiple `--class` arguments, or a
class argument with a comma separated value.
Add support for Redis 6 ACLs in the `Redis`, `RedisCluster`, and `RedisArray` classes.
On a related note, it adds a mechanism for users to customize how we generate persistent connection IDs such that they can be grouped in different ways depending on the specific use case required (e.g. it would allow connections to be grouped by username, or by user-defined persistent_id, or both).
Right now cloning the repo and running unit tests will all fail if the
Redis/RedisCluster instances aren't configured with the password
'phpredis'.
This commit simply makes authentication during the tests optional via a
command-line argument.
This commit implements UNLINK for Redis, RedisCluster, and RedisArray.
To a client library UNLINK behaves identically to DEL so we can use the
same handlers for both.
* Added a test specifically for RedisCluster to test slave failover
settings.
* Added an option to specifically disable colorization, as well as
a mechanism to determine if the output is being piped, such that
we can turn colorization off in that case as well.
This commit reworks the unit tests such that all three classes
(Redis, RedisArray, and RedisCluster) can be tested using the
TestRedis.php script.
Now, when running TestRedis.php an option can be passed for which
part of phpredis we would like to test (defaults to Redis).