* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object
* Fixed test, added dependecies
* Added resolved command to commands array
* Used aggregation approach for modules
* Added decorator to check Redis JSON module version
* Added support for JSON.SET and JSON.GET commands
* Added separate workflow for redis-stack tests
* Changed docker imange name to correct one
* Fixed indentation
* Added test coverage for JSON.GET command
* Changed module version resolving using annotations mapping
* Re-written CommandResolver test
* Update ClientInterface.php
* Changes to CI, readme, removed unused modules from configuration
* Fixed build badge URL
* Refactored annotation check to be generic for each module
* Added support for BF.ADD and BF.EXISTS commands
* Fixed bug with incorrect tests skip
* Changed module name according to original naming
* Revert some old changes
* Fixed misspelling
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object
* Fixed test, added dependecies
* Added resolved command to commands array
* Used aggregation approach for modules
* Added decorator to check Redis JSON module version
* Added support for JSON.SET and JSON.GET commands
* Added separate workflow for redis-stack tests
* Changed docker imange name to correct one
* Fixed indentation
* Added test coverage for JSON.GET command
* Changed module version resolving using annotations mapping
* Re-written CommandResolver test
* Update ClientInterface.php
* Changes to CI, readme, removed unused modules from configuration
* Fixed build badge URL
* Refactored annotation check to be generic for each module
* Fixed bug with incorrect tests skip
* Added CommandResolver, moved resolve command logic there, added ClientConfiguration object
* Fixed test, added dependecies
* Added resolved command to commands array
* Used aggregation approach for modules
* Added decorator to check Redis JSON module version
* Added support for JSON.SET and JSON.GET commands
* Added separate workflow for redis-stack tests
* Changed docker imange name to correct one
* Fixed indentation
* Added test coverage for JSON.GET command
* Changed module version resolving using annotations mapping
* Re-written CommandResolver test
* Update ClientInterface.php
* Changes to CI, readme, removed unused modules from configuration
* Fixed build badge URL
* Refactored annotation check to be generic for each module
* Fixed bug with incorrect tests skip
* Fixed naming issue with nxXx argument
* Removed redundant trait
* Fixed NxXxArgument test
* add Redis stack tests
* don't run tests twice
* use
* Update stack.yml
* Rename workflows
* Added version 6.x to workflow
* Removed exception thrown to avoid version bug
* Resolve conflicts within tests.yml
* Codestyle fixes
* Removew trailing whitespaces
Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Add complete CI
* Fix CI
* Fix spelling
* Fix indentation
* Fix CI
* Fix CI
* Revert disabling unit tests
* Add coverage driver to CI
* Start coverage debugging
* Fix debugging
ignored, and an empty message aborts the commit.
* Stop debugging
* Move TODO-s from source to GitHub issues
* Ignore too long lines in certain files
* Revert requiring php-parallel-lint/php-parallel-lint
* formatting
* try shorter formatting
* formatting
* fix syntax
* try two paths?
* Update .editorconfig
Co-authored-by: Viktor Szépe <viktor@szepe.net>
* indentation
* make it a group
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Basically assertMatchesRegularExpression() replaces assertRegExp() which
has been deprecated since PHPUnit 9.1 and will be removed in PHPUnit 10,
unfortunately we still depend on PHPUnit 8.4 to support PHP 7.2 and this
version does not have assertMatchesRegularExpression() so we implemented
it in our base testcase class with a fallback to the old assertRegExp()
when tests are executed on older versions of PHPUnit.
- Make use of more typehints for function parameters
- Make use of typehints for function return values
- Use @var where needed to give proper hints to IDEs and avoid warnings
- Replace MockObject::setMethods() with addMethods() and onlyMethods()
- Rewording of some phpdocs
This change reduces some unnecessary complexity in the library, Redis
commands do not change much after all. Developers can still implement
their own commands factory, inject new commands or override existing
ones. The "profile" client options has been renamed to "commands" and
it accepts instances of Predis\Command\FactoryInterface.
The test suite checks at runtime the version of the running instance
of Redis for integration tests to adapt itself automatically.
stream_socket_client() has the undocumented ability to open different persistent
streams by providing a path in the $address string. Previously we supported this
behaviour with a combination of "persistent" and "path" (see #139) but this can
be confusing, especially now that we support the redis:// scheme which uses the
path part of an URI string to specify a database number.
After this change, instead of using an URI string such as:
$parameters = 'tcp://127.0.0.1/first?persistent=1&database=5';
You should use the following ones:
$parameters = 'tcp://127.0.0.1?persistent=first&database=5';
$parameters = 'redis://127.0.0.1/5?persistent=first';
Avoiding "path" makes even more sense when using array connection parameters:
$parameters = [
'host' => '127.0.0.1',
'database' => 5,
'persistent' => 'first',
]
This feature is not supported when using UNIX domain sockets because the path
trick of stream_socket_client() does not play well with the actual path of the
socket file. The client will throw an InvalidArgumentException exception to
notify the user.
NOTE: unfortunately we have to disable the tests for persistent connections when
running under HHVM due to a bug in their implementation of get_resource_type()
preventing us to recognize a persistent stream from userland code.
This change is needed due to some internal changes in one of the
latest minor releases of PHPUnit 4.x that essentially broke how we
were checking for the required Redis version from method annotations.
This change targets only method annotations and aims to make the body
of tests more readable using the @requiresRedisVersion annotation.
Tests using this annotation requires to be assigned the "connected"
group of tests because they create a connection to the Redis instance
specified in phpunit.xml to fetch its the version.
This is a quick example of how this annotation can be used:
/**
* @group connected
* @requiresRedisVersion >= 2.8.9
*/
public function testExecutedOnlyWithMatchingRedisVersion()
{
}
Future improvements (currently not needed) include:
* Same annotation working on a class-level (but still applied only
to test methods with an explicitly assigned @group connected).
* Ability to specify a version range.
Meh
Meh
We now have a base test case class for Predis (namely PredisTestCase)
grouping various commonly used utility methods shared by all of the
tests in the suite, greatly improving reusability.