SQLite3CacheTest.php 838 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Doctrine\Tests\Common\Cache;
  3. use Doctrine\Common\Cache\Cache;
  4. use Doctrine\Common\Cache\SQLite3Cache;
  5. use SQLite3;
  6. /**
  7. * @requires extension sqlite3
  8. */
  9. class SQLite3Test extends CacheTest
  10. {
  11. private $file;
  12. private $sqlite;
  13. protected function setUp()
  14. {
  15. $this->file = tempnam(null, 'doctrine-cache-test-');
  16. unlink($this->file);
  17. $this->sqlite = new SQLite3($this->file);
  18. }
  19. protected function tearDown()
  20. {
  21. $this->sqlite = null; // DB must be closed before
  22. unlink($this->file);
  23. }
  24. public function testGetStats()
  25. {
  26. $this->assertNull($this->_getCacheDriver()->getStats());
  27. }
  28. /**
  29. * {@inheritDoc}
  30. */
  31. protected function _getCacheDriver()
  32. {
  33. return new SQLite3Cache($this->sqlite, 'test_table');
  34. }
  35. }