Skip to content

Commit b553fc4

Browse files
ScopeTest: assert getMultiple() isn't called
The Short circuit should prevent getMultiple from being called and we weren't explicitly check for that.
1 parent 0621920 commit b553fc4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/ScopeTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testScopeShortCircuitGet() {
6464
public function testScopeShortCircuitGetMultiple() {
6565
$scope = 'scope';
6666
$mockBackend = $this->getMockBuilder(Matryoshka\Ephemeral::class)
67-
->setMethods(['get'])
67+
->setMethods(['get', 'getMultiple'])
6868
->getMock();
6969

7070
// Assert get() is called only once because a missing scope value means
@@ -73,6 +73,11 @@ public function testScopeShortCircuitGetMultiple() {
7373
->method('get')
7474
->with($this->stringContains($scope))
7575
->willReturn(Matryoshka\Backend::MISS);
76+
// Assert getMultiple() is never called because a missi
77+
// we don't need to check individual keys.
78+
$mockBackend->expects($this->never())
79+
->method('getMultiple');
80+
7681
$scopedCache = new Matryoshka\Scope($mockBackend, $scope);
7782

7883
$key = (string)rand(1, 100000);

0 commit comments

Comments
 (0)