8000 Test cache has method with false value · laravel/framework@31b9359 · GitHub
[go: up one dir, main page]

Skip to content

Commit 31b9359

Browse files
committed
Test cache has method with false value
An issue was filed which caused some confusion about false being a valid cache value with the has method. Turns out that the current implementation is the correct one but the behavior wasn't tested yet. This extra test makes it clear. More on valid data values: https://www.php-fig.org/psr/psr-16/#14-data Referenced issue: #27630
1 parent c35bde2 commit 3
8000
1b9359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/Cache/CacheRepositoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ public function testHasMethod()
6666
$repo = $this->getRepository();
6767
$repo->getStore()->shouldReceive('get')->once()->with('foo')->andReturn(null);
6868
$repo->getStore()->shouldReceive('get')->once()->with('bar')->andReturn('bar');
69+
$repo->getStore()->shouldReceive('get')->once()->with('baz')->andReturn(false);
6970

7071
$this->assertTrue($repo->has('bar'));
7172
$this->assertFalse($repo->has('foo'));
73+
$this->assertTrue($repo->has('baz'));
7274
}
7375

7476
public function testMissingMethod()

0 commit comments

Comments
 (0)
0