From b8f6c0f4c0a0880430a274875b68455bb6edad8f Mon Sep 17 00:00:00 2001 From: Olivier Mansour Date: Sat, 15 Feb 2014 10:48:02 +0100 Subject: [PATCH] adding a test mocking Predis Client --- composer.json | 3 ++- tests/units/RedisMockFactory.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 54039ab..597ab1e 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "php": ">=5.3.3" }, "require-dev": { - "atoum/atoum": "master-dev" + "atoum/atoum": "master-dev", + "predis/predis": "~0.8" } } diff --git a/tests/units/RedisMockFactory.php b/tests/units/RedisMockFactory.php index 8522b8f..3cabbf0 100644 --- a/tests/units/RedisMockFactory.php +++ b/tests/units/RedisMockFactory.php @@ -150,6 +150,21 @@ public function testGetAdapterClass() ->error() ->notExists(); } + + /** + * mock a concrete Predis Client + * + * @return void + */ + public function testPredis() + { + $factory = new Factory(); + $mock = $factory->getAdapter('Predis\Client', true); + + $this->assert + ->object($mock) + ->isInstanceOf('M6Web\Component\RedisMock\RedisMock_Predis_Client_Adapter'); + } } class RedisWithMethods