class MemcacheCacheTest in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php \Doctrine\Tests\Common\Cache\MemcacheCacheTest
Hierarchy
- class \Doctrine\Tests\Common\Cache\CacheTest extends \Doctrine\Tests\DoctrineTestCase
- class \Doctrine\Tests\Common\Cache\MemcacheCacheTest
Expanded class hierarchy of MemcacheCacheTest
File
- vendor/
doctrine/ cache/ tests/ Doctrine/ Tests/ Common/ Cache/ MemcacheCacheTest.php, line 8
Namespace
Doctrine\Tests\Common\CacheView source
class MemcacheCacheTest extends CacheTest {
private $memcache;
public function setUp() {
if (!extension_loaded('memcache')) {
$this
->markTestSkipped('The ' . __CLASS__ . ' requires the use of memcache');
}
$this->memcache = new Memcache();
if (@$this->memcache
->connect('localhost', 11211) === false) {
unset($this->memcache);
$this
->markTestSkipped('The ' . __CLASS__ . ' cannot connect to memcache');
}
}
public function tearDown() {
if ($this->memcache instanceof Memcache) {
$this->memcache
->flush();
}
}
public function testNoExpire() {
$cache = $this
->_getCacheDriver();
$cache
->save('noexpire', 'value', 0);
sleep(1);
$this
->assertTrue($cache
->contains('noexpire'), 'Memcache provider should support no-expire');
}
public function testLongLifetime() {
$cache = $this
->_getCacheDriver();
$cache
->save('key', 'value', 30 * 24 * 3600 + 1);
$this
->assertTrue($cache
->contains('key'), 'Memcache provider should support TTL > 30 days');
}
protected function _getCacheDriver() {
$driver = new MemcacheCache();
$driver
->setMemcache($this->memcache);
return $driver;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheTest:: |
public | function | The following values get converted to FALSE if you cast them to a boolean. | |
CacheTest:: |
protected | function | Return whether multiple cache providers share the same storage. | 3 |
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | @dataProvider provideCrudValues | |
CacheTest:: |
public | function | Check to see that objects are correctly serialized and unserialized by the cache provider. | 1 |
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | Check to see that, even if the user saves a value that can be interpreted as false, the cache adapter will still recognize its existence there. | 2 |
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | Check to see that objects fetched via fetchMultiple are properly unserialized | 1 |
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | ||
CacheTest:: |
public | function | @group DCOM-43 | 8 |
CacheTest:: |
public | function | ||
MemcacheCacheTest:: |
private | property | ||
MemcacheCacheTest:: |
public | function | ||
MemcacheCacheTest:: |
public | function | ||
MemcacheCacheTest:: |
public | function | ||
MemcacheCacheTest:: |
public | function | ||
MemcacheCacheTest:: |
protected | function |
Overrides CacheTest:: |