Skip to content
This repository was archived by the owner on Sep 6, 2019. It is now read-only.

Commit e2909cc

Browse files
committed
updated Readme
1 parent d60881a commit e2909cc

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,4 @@ For example, if we are using the `apc` driver, which does not offer its own `get
180180

181181
Now if we are using the `memcached` driver, which does have its own `getMulti` method, then that method will be called once and the data returned.
182182

183-
Currently the `MemcachedStore`, `DatabaseStore` and the `ArrayStore` are the only ones to offer their own `Multi` methods. **More to come soon...**
183+
Currently the `MemcachedStore`, `DatabaseStore`, `RedisStore` and the `ArrayStore` are the only ones to offer their own `Multi` methods. **More to come soon...**

tests/CacheRepositoryTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public function testHasMethod()
5353
$repo->getStore()->shouldReceive('get')->twice()->andReturn('baz');
5454
$this->assertEquals(['foo' => true, 'bar' => true], $repo->has(['foo', 'bar']));
5555

56+
$repo->getStore()->shouldReceive('get')->once()->with('foo')->andReturn(null);
57+
$repo->getStore()->shouldReceive('get')->once()->with('bar')->andReturn('bar');
58+
59+
$this->assertTrue($repo->has('bar'));
60+
$this->assertFalse($repo->has('foo'));
61+
5662
$repo = $this->getRepository(StoreMulti::class);
5763
$repo->getStore()->shouldReceive('getMulti')->once()->andReturn(['foo' => null, 'bar' => null]);
5864
$this->assertEquals(['foo' => false, 'bar' => false], $repo->has(['foo', 'bar']));
@@ -74,6 +80,11 @@ public function testAddMethod()
7480
$repo->getStore()->shouldReceive('put')->once()->with('baz', 'boom', 10);
7581
$repo->add(['foo', 'baz'], ['bar', 'boom'], 10);
7682

83+
$repo->getStore()->shouldReceive('get')->once()->with('foo')->andReturn(null);
84+
$repo->getStore()->shouldReceive('put')->once()->with('foo', 'bar', 10);
85+
86+
$repo->add('foo', 'bar', 10);
87+
7788
$repo = $this->getRepository(StoreMulti::class);
7889
$repo->getStore()->shouldReceive('getMulti')->once()->andReturn(['foo' => null, 'baz' => null]);
7990
$repo->getStore()->shouldReceive('putMulti')->once()->with(['foo' => 'bar', 'baz' => 'boom'], 10);
@@ -99,6 +110,11 @@ public function testPullMethod()
99110
$repo->getStore()->shouldReceive('forget')->once()->with('baz')->andReturn(true);
100111
$this->assertEquals(['foo' => 'bar', 'baz' => 'boom'], $repo->pull(['foo', 'baz']));
101112

113+
$repo->getStore()->shouldReceive('get')->once()->with('foo')->andReturn('bar');
114+
$repo->getStore()->shouldReceive('forget')->once()->with('foo')->andReturn(true);
115+
116+
$this->assertEquals('bar', $repo->pull('foo'));
117+
102118
$repo = $this->getRepository(StoreMulti::class);
103119
$repo->getStore()->shouldReceive('getMulti')->once()->andReturn(['foo' => 'bar', 'baz' => 'boom']);
104120
$repo->getStore()->shouldReceive('forgetMulti')->once()->with(['foo', 'baz'])->andReturn(['foo' => true, 'baz' => true]);

0 commit comments

Comments
 (0)