130 Commits

Author SHA1 Message Date
Michael Grunder
514bc37102 Verify SET options are strings before testing them as strings. (#1859)
Addresses #1835
2020-10-13 13:05:20 -07:00
Michael Grunder
950e8de807 Issue.1847 cluster segfault (#1850)
Fix for #1847 when dealing with NULL multi bulk replies in RedisCluster.

Adds `Redis::OPT_NULL_MULTIBULK_AS_NULL` setting to have PhpRedis
treat NULL multi bulk replies as `NULL` instead of `[]`.

Co-authored-by: Alex Offshore <offshore@aopdg.ru>
2020-09-28 11:07:46 -07:00
Remi Collet
f4a30cb2bd fix 1 test for PHP 8, use call_user_func when no arg 2020-09-11 09:37:11 +02:00
Michael Grunder
3645807188 Relax requirements on set's expire argument (#1830)
Relax requirements on set's expire argument

See: #1783
2020-08-30 13:51:12 -07:00
michael-grunder
566fdeeb19 Add a regression test for XINFO on empty stream 2020-08-28 10:03:38 -07:00
michael-grunder
14ac969da2 Add a test for passing NULL to auth 2020-07-07 10:43:31 -07:00
Michael Grunder
a311cc4ec3 Support for Redis 6 ACLs (#1791)
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).
2020-06-24 17:00:01 -07:00
Michael Grunder
04def9fbe2 Rebased LZ4 PR (#1781)
LZ4 compression by @iliaal
2020-06-07 14:09:30 -07:00
Michael Grunder
a0c53e0b30 Issue.1762 xinfo full (#1771)
Add support for `XINFO STREAM FULL [COUNT]`
2020-06-07 13:48:06 -07:00
Pavlo Yatsukhnenko
890ee0e656 TravisCI: test tls connect 2020-06-05 09:40:53 +03:00
Michael Grunder
f9c7bb5788 Adds Redis 6.0 KEEPTTL option for SET (#1766)
Added support for KEEPTTL option of SET command, which added in Redis 6

See: #1761

Co-authored-by: victor <viktork@sekindo.com>
2020-05-23 14:25:41 -07:00
Pavlo Yatsukhnenko
e80600e244 Issue #548 (#1649)
Adds `Redis::SCAN_PREFIX` and `Redis::SCAN_NOPREFIX` as options to SCAN.

See #548
2020-05-18 18:11:40 -07:00
Michael Grunder
201a975999 Make unit test authentication configurable (#1748)
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.
2020-04-30 21:22:40 -07:00
Pavlo Yatsukhnenko
e37f38a39e requirepass 2020-03-30 13:32:27 +03:00
Pavlo Yatsukhnenko
7e4c7b3e69 Change version_compare usage in tests 2020-03-09 14:19:26 +02:00
Michael Grunder
0ce7ca2fb1 Issue.1714 json session tests (#1717)
* Add json.so as well if we don't find it.

See #1714

* Remove added newline
2020-03-02 11:03:51 -08:00
michael-grunder
b1724b8482 Use proper version compare 2020-02-06 14:01:52 -08:00
michael-grunder
53fb36c9d3 Remove additional TYPE test 2020-02-06 14:01:52 -08:00
michael-grunder
544e641bf2 Adds a test for #1646
NOTE:  [This
comment](https://github.com/antirez/redis/pull/6116#issuecomment-509331565)
indicates the feature may be backported to Redis 5, so we'll want to
change our unit test if that happens.
2020-02-06 14:01:52 -08:00
michael-grunder
c3d83d4460 Create a specific exception for 'test skipped'
I our test suite we were only checking if an exception was an instance
of `RedisException` and marking the test 'SKIPPED' if not.  This was
masking a failure in the RedisCluster test for testMultiExec by showing
it as skipped when it was actually throwing an exception (not being able
to execute the MULTI across the cluster).
2020-01-21 10:07:00 -08:00
michael-grunder
9f4ededa41 Tests for unix socket and high ports
Adds some tests to protect against regressions when connecting to unix
sockets and high ports.
2019-11-04 17:21:55 -08:00
Remi Collet
2abc61da31 Add support for Zstd compression 2019-07-09 10:00:40 +02:00
Pavlo Yatsukhnenko
235a27e7c0 Issue #1577
Remove checking of version of msgpack.
Allow to disable json serializer.
Fix tests.
2019-06-21 11:55:13 -07:00
michael-grunder
95c8aab9df Soft deprecate methods that aren't actually Redis commands.
Addresses #1168
2019-06-16 15:58:00 -07:00
michael-grunder
19e47b4b32 Revert to using PHP's time 2019-06-16 11:44:49 -07:00
michael-grunder
9a699e5308 Try to give the EXPIREAT test a bit more leeway to succeed. 2019-06-16 11:38:45 -07:00
Pavlo Yatsukhnenko
4852a5106a xInfo response format 2019-06-12 12:20:38 +03:00
michael-grunder
0c17bd27a0 Make the XREADGROUP optional COUNT and BLOCK arguments nullable.
Change the way we accept COUNT and BLOCK such that a user can pass NULL
to mean "no value".  This is technically a breaking change, since
previously the value `-1` was used for "no value".

Fixes #1560
2019-06-04 13:37:52 -07:00
michael-grunder
6e49417068 Allow PING to take an optional argument.
Addresses #1563
2019-06-03 07:53:21 -07:00
Michael Grunder
19f3efcfe6 Issue.1555 zrange withscores arg (#1565)
Allows ZRANGE to be called either with `true` or `['withscores' => true]` so it's consistent with `ZRANGEBYSCORE` but also backward compatible.

Fixes #1555
2019-06-02 17:44:26 -07:00
michael-grunder
5cb30fb2a6 Adds OPT_REPLY_LITERAL for rawCommand and EVAL
Adds an option to process the actual strings in simple string replies as
opposed to translating them to `true`.  This only applies to
`rawCommand` and `eval` because as far as I know know vanilla Redis
command attaches any information besides `OK` to simple string replies.

Addresses #1550
2019-05-13 09:38:18 -07:00
Pavlo Yatsukhnenko
98bd2886c3 JSON serializer 2019-05-12 15:30:47 +03:00
michael-grunder
d7450b2f59 Add support for STREAM to the type command 2019-04-16 08:16:12 -07:00
B. Gortney
d5b8f83340 rebase msgpack pull request (#801) on develop branch 2019-03-23 16:55:43 +02:00
michael-grunder
eb81b9153c Merge branch 'issue-1509' into issue.1448-require_php7 2019-02-23 17:41:19 -08:00
michael-grunder
f89e941a88 Change ZPOP* return type and implement blocking variants
This commit updates ZPOPMIN/ZPOPMAX to return the same format that
zRange WITHSCORES and zRangeByScore WITHSCORES does.

In addition the blocking variants BZPOPMIN and BZPOPMAX are implemented.
2019-02-18 20:00:08 -08:00
Marin Bezhanov
46f035615e Add ZPOPMAX and ZPOPMIN support 2019-02-17 13:05:58 +02:00
michael-grunder
85419ce7d3 Merge branch 'issue.1502.geo-readonly-cmds' into issue.1448-require_php7 2019-02-14 10:21:00 -08:00
michael-grunder
22d81a94ee Implement GEORADIUS_RO and GEORADIUSBYMEMBER_RO
This addresses #1502, #1487
2019-02-13 13:07:35 -08:00
michael-grunder
9440f05e19 Switch everything to new array syntax 2019-02-09 14:12:52 -08:00
Michael Grunder
15995c06e3 Xgroup updates (#1499)
Adds support for XGROUP CREATE ... MKSTREAM, and support at all for XGROUP DESTROY.
2019-01-24 08:36:58 -08:00
Pavlo Yatsukhnenko
018ec177a7 Add testDiscard 2019-01-10 21:55:57 +02:00
michael-grunder
7b8b7b01a2 Fix unit tests for Redis 5.0.2
Addresses issue #1472
2018-12-08 15:11:12 -08:00
Michael Grunder
91bd7426d5 Masters info leakfix (#1462)
Fix for memory leaks in `RedisCluster->_masters()` and `RedisCluster->info()`
2018-11-22 11:37:18 -08:00
michael-grunder
2e412373c4 Use a ZSET insted of SET for EVAL tests
Redis SET type is unordered which could break our eval tests
so use a ZSET instead where the order is deterministic.
2018-10-12 08:36:48 -07:00
Remi Collet
0af2a7fe06 missing space between command and args 2018-10-12 00:24:16 -07:00
Michael Grunder
2c9e057236 Streams (#1413)
Streams API
2018-09-29 11:59:01 -07:00
michael-grunder
bfd274712e Modify session testing logic
In the event that the test PHP executable has been built with redis
and/or igbinary support built statically, we don't need to try and
find it by adding --no-php-ini and the extension directives themselves.

This fixes the test execution when php has the required extensions
already.
2018-09-20 22:23:40 -07:00
michael-grunder
d4a086979f Allow '-' and '+' arguments and add tests for zLexCount and zRemRangeByLex 2018-09-18 17:00:21 -07:00
Pavlo Yatsukhnenko
fa5f6e1411 Merge pull request #1365 from remicollet/issue-runcmd
use PHP_BINARY instead of php and allow override
2018-06-08 17:56:41 +03:00