FilesystemCacheTest.php 860 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of Mustache.php.
  4. *
  5. * (c) 2010-2016 Justin Hileman
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * @group functional
  12. */
  13. class Mustache_Test_Cache_FilesystemCacheTest extends Mustache_Test_FunctionalTestCase
  14. {
  15. public function testCacheGetNone()
  16. {
  17. $key = 'some key';
  18. $cache = new Mustache_Cache_FilesystemCache(self::$tempDir);
  19. $loaded = $cache->load($key);
  20. $this->assertFalse($loaded);
  21. }
  22. public function testCachePut()
  23. {
  24. $key = 'some key';
  25. $value = '<?php /* some value */';
  26. $cache = new Mustache_Cache_FilesystemCache(self::$tempDir);
  27. $cache->cache($key, $value);
  28. $loaded = $cache->load($key);
  29. $this->assertTrue($loaded);
  30. }
  31. }