3 namespace Doctrine\Tests\Common\Cache;
5 use Doctrine\Common\Cache\VoidCache;
8 * @covers \Doctrine\Common\Cache\VoidCache
10 class VoidCacheTest extends \PHPUnit_Framework_TestCase
12 public function testShouldAlwaysReturnFalseOnContains()
14 $cache = new VoidCache();
16 $this->assertFalse($cache->contains('foo'));
17 $this->assertFalse($cache->contains('bar'));
20 public function testShouldAlwaysReturnFalseOnFetch()
22 $cache = new VoidCache();
24 $this->assertFalse($cache->fetch('foo'));
25 $this->assertFalse($cache->fetch('bar'));
28 public function testShouldAlwaysReturnTrueOnSaveButNotStoreAnything()
30 $cache = new VoidCache();
32 $this->assertTrue($cache->save('foo', 'fooVal'));
34 $this->assertFalse($cache->contains('foo'));
35 $this->assertFalse($cache->fetch('foo'));
38 public function testShouldAlwaysReturnTrueOnDelete()
40 $cache = new VoidCache();
42 $this->assertTrue($cache->delete('foo'));
45 public function testShouldAlwaysReturnNullOnGetStatus()
47 $cache = new VoidCache();
49 $this->assertNull($cache->getStats());
52 public function testShouldAlwaysReturnTrueOnFlush()
54 $cache = new VoidCache();
56 $this->assertTrue($cache->flushAll());