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 2
2
3
3
use Illuminated \Console \Mutex ;
4
4
use NinjaMutex \Lock \FlockLock ;
5
+ use NinjaMutex \Lock \MemcachedLock ;
5
6
use NinjaMutex \Lock \MySqlLock ;
6
7
use NinjaMutex \Lock \PredisRedisLock ;
7
8
@@ -60,4 +61,16 @@ public function it_supports_redis_strategy()
60
61
$ expectedStrategy = new PredisRedisLock (Redis::connection ());
61
62
$ this ->assertEquals ($ expectedStrategy , $ mutex ->getStrategy ());
62
63
}
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
+ }
63
76
}
You can’t perform that action at this time.
0 commit comments