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.
17 * @subpackage UnitTests
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
26 require_once 'Zend/Cache.php';
27 require_once 'Zend/Cache/Backend/ZendServer/ShMem.php';
30 * Common tests for backends
32 require_once 'CommonBackendTest.php';
37 require_once 'PHPUnit/Framework/TestCase.php';
42 * @subpackage UnitTests
43 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
44 * @license http://framework.zend.com/license/new-bsd New BSD License
47 class Zend_Cache_ZendServerShMemTest
extends Zend_Cache_CommonBackendTest
{
51 public function __construct($name = null, array $data = array(), $dataName = '')
53 parent
::__construct('Zend_Cache_Backend_ZendServer_Disk', $data, $dataName);
56 public function setUp($notag = true)
58 $this->_instance
= new Zend_Cache_Backend_ZendServer_ShMem();
62 public function tearDown()
65 unset($this->_instance
);
68 public function testConstructorCorrectCall()
70 $test = new Zend_Cache_Backend_ZendServer_ShMem();
73 public function testCleanModeOld() {
74 $this->_instance
->setDirectives(array('logging' => false));
75 $this->_instance
->clean('old');
76 // do nothing, just to see if an error occured
77 $this->_instance
->setDirectives(array('logging' => true));
80 public function testCleanModeMatchingTags() {
81 $this->_instance
->setDirectives(array('logging' => false));
82 $this->_instance
->clean('matchingTag', array('tag1'));
83 // do nothing, just to see if an error occured
84 $this->_instance
->setDirectives(array('logging' => true));
87 public function testCleanModeNotMatchingTags() {
88 $this->_instance
->setDirectives(array('logging' => false));
89 $this->_instance
->clean('notMatchingTag', array('tag1'));
90 // do nothing, just to see if an error occured
91 $this->_instance
->setDirectives(array('logging' => true));
94 // Because of limitations of this backend...
95 public function testGetWithAnExpiredCacheId() {}
96 public function testCleanModeMatchingTags2() {}
97 public function testCleanModeNotMatchingTags2() {}
98 public function testCleanModeNotMatchingTags3() {}
99 public function testSaveCorrectCall()
101 $this->_instance
->setDirectives(array('logging' => false));
102 parent
::testSaveCorrectCall();
103 $this->_instance
->setDirectives(array('logging' => true));
106 public function testSaveWithNullLifeTime()
108 $this->_instance
->setDirectives(array('logging' => false));
109 parent
::testSaveWithNullLifeTime();
110 $this->_instance
->setDirectives(array('logging' => true));
113 public function testSaveWithSpecificLifeTime()
116 $this->_instance
->setDirectives(array('logging' => false));
117 parent
::testSaveWithSpecificLifeTime();
118 $this->_instance
->setDirectives(array('logging' => true));