PhpArrayCacheWithFallbackTest.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Cache\Tests\Simple;
  11. use Symfony\Component\Cache\Simple\FilesystemCache;
  12. use Symfony\Component\Cache\Simple\PhpArrayCache;
  13. use Symfony\Component\Cache\Tests\Adapter\FilesystemAdapterTest;
  14. /**
  15. * @group time-sensitive
  16. */
  17. class PhpArrayCacheWithFallbackTest extends CacheTestCase
  18. {
  19. protected $skippedTests = [
  20. 'testGetInvalidKeys' => 'PhpArrayCache does no validation',
  21. 'testGetMultipleInvalidKeys' => 'PhpArrayCache does no validation',
  22. 'testDeleteInvalidKeys' => 'PhpArrayCache does no validation',
  23. 'testDeleteMultipleInvalidKeys' => 'PhpArrayCache does no validation',
  24. //'testSetValidData' => 'PhpArrayCache does no validation',
  25. 'testSetInvalidKeys' => 'PhpArrayCache does no validation',
  26. 'testSetInvalidTtl' => 'PhpArrayCache does no validation',
  27. 'testSetMultipleInvalidKeys' => 'PhpArrayCache does no validation',
  28. 'testSetMultipleInvalidTtl' => 'PhpArrayCache does no validation',
  29. 'testHasInvalidKeys' => 'PhpArrayCache does no validation',
  30. 'testPrune' => 'PhpArrayCache just proxies',
  31. ];
  32. protected static $file;
  33. public static function setupBeforeClass()
  34. {
  35. self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
  36. }
  37. protected function tearDown()
  38. {
  39. if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
  40. FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');
  41. }
  42. }
  43. public function createSimpleCache($defaultLifetime = 0)
  44. {
  45. return new PhpArrayCache(self::$file, new FilesystemCache('php-array-fallback', $defaultLifetime));
  46. }
  47. }