Skip to content

Commit d0c00a2

Browse files
committed
add: regression test for increment method about expired cache
1 parent 5beb0b7 commit d0c00a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/Cache/MongoCacheStoreTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ public function testIncrementDecrement()
199199

200200
$this->insertToCacheTable('foo', 10, -5);
201201
$this->assertFalse($store->increment('foo', 5));
202+
203+
$doc = DB::connection('mongodb')
204+
->getCollection($this->getCacheCollectionName())
205+
->findOne(
206+
['_id' => $this->withCachePrefix('foo')],
207+
['projection' => ['value' => 1]]
208+
);
209+
$this->assertSame(10, $doc['value']);
202210
}
203211

204212
public function testTTLIndex()

0 commit comments

Comments
 (0)