Skip to content

Commit fff3e72

Browse files
committed
ICM: Laravel 5.1+ support.
1 parent 7bebd79 commit fff3e72

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/MutexTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
use NinjaMutex\Lock\MemcachedLock;
66
use NinjaMutex\Lock\MySqlLock;
77
use NinjaMutex\Lock\PredisRedisLock;
8+
use Predis\Client;
89

910
class MutexTest extends TestCase
1011
{
1112
private $command;
1213

13-
protected function setUp()
14+
public function setUp()
1415
{
1516
parent::setUp();
1617

@@ -52,13 +53,20 @@ public function it_supports_mysql_strategy()
5253
$this->assertEquals($expectedStrategy, $mutex->getStrategy());
5354
}
5455

56+
/** @test */
57+
public function it_has_get_redis_client_method()
58+
{
59+
$mutex = new Mutex($this->command);
60+
$this->assertInstanceOf(Client::class, $mutex->getRedisClient());
61+
}
62+
5563
/** @test */
5664
public function it_supports_redis_strategy()
5765
{
5866
$this->command->shouldReceive('getMutexStrategy')->withNoArgs()->once()->andReturn('redis');
5967

6068
$mutex = new Mutex($this->command);
61-
$expectedStrategy = new PredisRedisLock(Redis::connection()->client());
69+
$expectedStrategy = new PredisRedisLock($mutex->getRedisClient());
6270
$this->assertEquals($expectedStrategy, $mutex->getStrategy());
6371
}
6472

0 commit comments

Comments
 (0)