File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 22
33use Illuminated \Console \Mutex ;
44use NinjaMutex \Lock \FlockLock ;
5+ use NinjaMutex \Lock \MemcachedLock ;
56use NinjaMutex \Lock \MySqlLock ;
67use NinjaMutex \Lock \PredisRedisLock ;
78
@@ -60,4 +61,16 @@ public function it_supports_redis_strategy()
6061 $ expectedStrategy = new PredisRedisLock (Redis::connection ());
6162 $ this ->assertEquals ($ expectedStrategy , $ mutex ->getStrategy ());
6263 }
64+
65+ /** @test */
66+ public function it_supports_memcached_strategy ()
67+ {
68+ Cache::shouldReceive ('getStore ' )->withNoArgs ()->twice ()->andReturnSelf ();
69+ Cache::shouldReceive ('getMemcached ' )->withNoArgs ()->twice ()->andReturnSelf ();
70+ $ this ->command ->shouldReceive ('getMutexStrategy ' )->withNoArgs ()->once ()->andReturn ('memcached ' );
71+
72+ $ mutex = new Mutex ($ this ->command );
73+ $ expectedStrategy = new MemcachedLock (Cache::getStore ()->getMemcached ());
74+ $ this ->assertEquals ($ expectedStrategy , $ mutex ->getStrategy ());
75+ }
6376}
You can’t perform that action at this time.
0 commit comments