PhpArrayAdapterWithFallbackTest.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\Adapter;
  11. use Symfony\Component\Cache\Adapter\FilesystemAdapter;
  12. use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
  13. /**
  14. * @group time-sensitive
  15. */
  16. class PhpArrayAdapterWithFallbackTest extends AdapterTestCase
  17. {
  18. protected $skippedTests = [
  19. 'testGetItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
  20. 'testGetItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
  21. 'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
  22. 'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
  23. 'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
  24. 'testPrune' => 'PhpArrayAdapter just proxies',
  25. ];
  26. protected static $file;
  27. public static function setupBeforeClass()
  28. {
  29. self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
  30. }
  31. protected function tearDown()
  32. {
  33. if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
  34. FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');
  35. }
  36. }
  37. public function createCachePool($defaultLifetime = 0)
  38. {
  39. return new PhpArrayAdapter(self::$file, new FilesystemAdapter('php-array-fallback', $defaultLifetime));
  40. }
  41. }