10 Commits

Author SHA1 Message Date
Michael Grunder
b88e72b1e6 Refactor session tests (#2492)
* Refactor session tests

* Update these external scripts to take formal arguments with `getopt` to
  make it more straightforward what each of the currently positional
  arguments are actually for.

* Create small helper classes for invoking these external scripts.
  Instead of `startSessionProcess` that takes a dozen argument all but
  three of which have defaults, we can use a construct like this:

  ```php
  $runner = $this->sessionRunner()
      ->maxExecutionTime(300)
      ->lockingEnabled(true)
      ->lockWaitTime(-1)
      ->lockExpires(0)
      ->data($data)
      ->compression($name);

  // Invokes startSession.php with above args.
  $result = $runner->execFg();

  // Invokes regenerateSessionId.php with above args
  $new_id = $runner->regenerateId();

  // Invokes getSessionData.php for this session ID.
  $data = $runner->getData();
  ```

* Add a bit of logic to TestSuite to dump more information about the
  source of an assertion to make it easier to track down problems when
  we assert outside of a top level public `test_*` method.

* Create a few new assertions like `assertKeyExists` and
  `assertKeyMissing` which will generate much nicer assertions as
  opposed to

```php
$this->assertTrue($this->redis->exists($some_key));
```

* If our externally spawned session scripts fail output the exact call
  that was made along with all arguments as well as the output that we
  received to make it easier to narrow down.

* snake_case -> camelCase
2024-05-23 09:43:36 -07:00
michael-grunder
9f3ca98c00 Add a test for session compression.
See #2473 #2480
2024-04-08 20:16:27 -07:00
Pavlo Yatsukhnenko
9f8f80ca9d sessionSaveHandler 2023-12-19 20:01:47 +02:00
Remi Collet
1784879191 fix arg indexes 2020-09-11 10:15:30 +02: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
Marius Meissner
d0cada2268 PHPREDIS-1354: Refactored tests to work also with Redis cluster 2018-06-06 09:55:50 +02:00
Marius Meissner
e2d5b5ea49 PHPREDIS-1354: Added session TTL tests 2018-05-22 17:24:47 +02:00
Marius Meissner
810df7bcf2 PHPREDIS-37: Adjusted error reporting to show warnings but no notices 2017-11-02 15:28:28 +01:00
Marius Meissner
97e034efb0 PHPREDIS-37: Disabled error_reporting for session tests, to avoid failing tests caused by correct thrown warnings/notices 2017-11-02 14:24:51 +01:00
Marius Meissner
abb862d2f5 PHPREDIS-37: Add locking functionality 2017-10-30 11:28:33 +01:00