Skip to content

Commit 8bd0926

Browse files
committed
Fixed travis.
1 parent 7351fdf commit 8bd0926

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Lua/Script.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class Script implements ScriptInterface
2525
protected $redis;
2626

2727
/**
28-
* @var string
28+
* @var null|string
2929
*/
3030
protected $sha;
3131

tests/Stub/ContainerStub.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ContainerStub
3131
public static function mockContainer()
3232
{
3333
$container = Mockery::mock(Container::class);
34-
$container->shouldReceive('get')->once()->with(ConfigInterface::class)->andReturn(new Config([
34+
$container->shouldReceive('get')->with(ConfigInterface::class)->andReturn(new Config([
3535
'redis' => [
3636
'default' => [
3737
'host' => 'localhost',
@@ -49,20 +49,21 @@ public static function mockContainer()
4949
],
5050
],
5151
]));
52-
$pool = new RedisPool($container, 'default');
5352
$frequency = Mockery::mock(LowFrequencyInterface::class);
5453
$frequency->shouldReceive('isLowFrequency')->andReturn(false);
5554
$container->shouldReceive('make')->with(Frequency::class, Mockery::any())->andReturn($frequency);
56-
$container->shouldReceive('make')->with(RedisPool::class, ['name' => 'default'])->andReturn($pool);
55+
$container->shouldReceive('make')->with(RedisPool::class, ['name' => 'default'])->andReturnUsing(function () use ($container) {
56+
return new RedisPool($container, 'default');
57+
});
5758
$container->shouldReceive('make')->with(Channel::class, ['size' => 30])->andReturn(new Channel(30));
5859
$container->shouldReceive('make')->with(PoolOption::class, Mockery::any())->andReturnUsing(function ($class, $args) {
5960
return new PoolOption(...array_values($args));
6061
});
6162
$container->shouldReceive('has')->with(\Redis::class)->andReturn(true);
62-
$container->shouldReceive('get')->with(\Redis::class)->andReturn(value(function () use ($container) {
63+
$container->shouldReceive('get')->with(\Redis::class)->andReturnUsing(function () use ($container) {
6364
$factory = new PoolFactory($container);
6465
return new Redis($factory);
65-
}));
66+
});
6667
$container->shouldReceive('has')->with(StdoutLoggerInterface::class)->andReturn(true);
6768
$container->shouldReceive('get')->with(StdoutLoggerInterface::class)->andReturn(value(function () {
6869
return Mockery::mock(StdoutLoggerInterface::class);

0 commit comments

Comments
 (0)