WinCacheBackendTest.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Cache
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * Zend_Cache
  24. */
  25. require_once 'Zend/Cache.php';
  26. require_once 'Zend/Cache/Backend/WinCache.php';
  27. /**
  28. * Common tests for backends
  29. */
  30. require_once 'CommonExtendedBackendTest.php';
  31. /**
  32. * @category Zend
  33. * @package Zend_Cache
  34. * @subpackage UnitTests
  35. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  36. * @license http://framework.zend.com/license/new-bsd New BSD License
  37. * @group Zend_Cache
  38. */
  39. class Zend_Cache_WinCacheBackendTest extends Zend_Cache_CommonExtendedBackendTest {
  40. protected $_instance;
  41. public function __construct($name = null, array $data = array(), $dataName = '')
  42. {
  43. parent::__construct('Zend_Cache_Backend_WinCache', $data, $dataName);
  44. }
  45. public function setUp($notag = true)
  46. {
  47. $this->_instance = new Zend_Cache_Backend_WinCache(array());
  48. parent::setUp($notag);
  49. }
  50. public function tearDown()
  51. {
  52. parent::tearDown();
  53. unset($this->_instance);
  54. }
  55. public function testConstructorCorrectCall()
  56. {
  57. $test = new Zend_Cache_Backend_WinCache();
  58. }
  59. public function testCleanModeOld() {
  60. $this->_instance->setDirectives(array('logging' => false));
  61. $this->_instance->clean('old');
  62. // do nothing, just to see if an error occured
  63. $this->_instance->setDirectives(array('logging' => true));
  64. }
  65. public function testCleanModeMatchingTags() {
  66. $this->_instance->setDirectives(array('logging' => false));
  67. $this->_instance->clean('matchingTag', array('tag1'));
  68. // do nothing, just to see if an error occured
  69. $this->_instance->setDirectives(array('logging' => true));
  70. }
  71. public function testCleanModeNotMatchingTags() {
  72. $this->_instance->setDirectives(array('logging' => false));
  73. $this->_instance->clean('notMatchingTag', array('tag1'));
  74. // do nothing, just to see if an error occured
  75. $this->_instance->setDirectives(array('logging' => true));
  76. }
  77. // Because of limitations of this backend...
  78. public function testGetWithAnExpiredCacheId() {
  79. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  80. }
  81. public function testCleanModeMatchingTags2() {
  82. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  83. }
  84. public function testCleanModeNotMatchingTags2() {
  85. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  86. }
  87. public function testCleanModeNotMatchingTags3() {
  88. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  89. }
  90. public function testGetIdsMatchingTags() {
  91. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  92. }
  93. public function testGetIdsMatchingTags2() {
  94. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  95. }
  96. public function testGetIdsMatchingTags3() {
  97. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  98. }
  99. public function testGetIdsMatchingTags4() {
  100. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  101. }
  102. public function testGetIdsNotMatchingTags() {
  103. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  104. }
  105. public function testGetIdsNotMatchingTags2() {
  106. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  107. }
  108. public function testGetIdsNotMatchingTags3() {
  109. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  110. }
  111. public function testGetTags() {
  112. $this->markTestSkipped('This test skipped due to limitations in this adapter.');
  113. }
  114. public function testSaveCorrectCall()
  115. {
  116. $this->_instance->setDirectives(array('logging' => false));
  117. parent::testSaveCorrectCall();
  118. $this->_instance->setDirectives(array('logging' => true));
  119. }
  120. public function testSaveWithNullLifeTime()
  121. {
  122. $this->_instance->setDirectives(array('logging' => false));
  123. parent::testSaveWithNullLifeTime();
  124. $this->_instance->setDirectives(array('logging' => true));
  125. }
  126. public function testSaveWithSpecificLifeTime()
  127. {
  128. $this->_instance->setDirectives(array('logging' => false));
  129. parent::testSaveWithSpecificLifeTime();
  130. $this->_instance->setDirectives(array('logging' => true));
  131. }
  132. public function testGetMetadatas($notag = true)
  133. {
  134. parent::testGetMetadatas($notag);
  135. }
  136. }