Completed
Push — master ( a8b991...dda2b8 )
by Marco
06:05 queued 02:56
created

testShouldAlwaysReturnFalseOnFetch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Doctrine\Tests\Common\Cache;
4
5
use Doctrine\Common\Cache\VoidCache;
6
7
/**
8
 * @covers \Doctrine\Common\Cache\VoidCache
9
 */
10
class VoidCacheTest extends \PHPUnit_Framework_TestCase
11
{
12
    public function testShouldAlwaysReturnFalseOnContains()
13
    {
14
        $cache = new VoidCache();
15
16
        $this->assertFalse($cache->contains('foo'));
17
        $this->assertFalse($cache->contains('bar'));
18
    }
19
20
    public function testShouldAlwaysReturnFalseOnFetch()
21
    {
22
        $cache = new VoidCache();
23
24
        $this->assertFalse($cache->fetch('foo'));
25
        $this->assertFalse($cache->fetch('bar'));
26
    }
27
28
    public function testShouldAlwaysReturnTrueOnSaveButNotStoreAnything()
29
    {
30
        $cache = new VoidCache();
31
32
        $this->assertTrue($cache->save('foo', 'fooVal'));
33
34
        $this->assertFalse($cache->contains('foo'));
35
        $this->assertFalse($cache->fetch('foo'));
36
    }
37
38
    public function testShouldAlwaysReturnTrueOnDelete()
39
    {
40
        $cache = new VoidCache();
41
42
        $this->assertTrue($cache->delete('foo'));
43
    }
44
45
    public function testShouldAlwaysReturnNullOnGetStatus()
46
    {
47
        $cache = new VoidCache();
48
49
        $this->assertNull($cache->getStats());
50
    }
51
52
    public function testShouldAlwaysReturnTrueOnFlush()
53
    {
54
        $cache = new VoidCache();
55
56
        $this->assertTrue($cache->flushAll());
57
    }
58
}
59