SqliteProfilerStorageTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\HttpKernel\Tests\Profiler;
  11. use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
  12. /**
  13. * @group legacy
  14. * @requires extension pdo_sqlite
  15. */
  16. class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
  17. {
  18. private $dbFile;
  19. private $storage;
  20. protected function setUp()
  21. {
  22. $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_storage');
  23. if (file_exists($this->dbFile)) {
  24. @unlink($this->dbFile);
  25. }
  26. $this->storage = new SqliteProfilerStorage('sqlite:'.$this->dbFile);
  27. $this->storage->purge();
  28. }
  29. protected function tearDown()
  30. {
  31. @unlink($this->dbFile);
  32. }
  33. /**
  34. * @return \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
  35. */
  36. protected function getStorage()
  37. {
  38. return $this->storage;
  39. }
  40. }