8ab7e5b4721f458691f640d1d742f990dd80d938
[yaffs-website] / vendor / doctrine / cache / tests / Doctrine / Tests / Common / Cache / VoidCacheTest.php
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 }