You are here

class CouchbaseCacheTest in Plug 7

Hierarchy

  • class \Doctrine\Tests\Common\Cache\CacheTest extends \Doctrine\Tests\DoctrineTestCase

Expanded class hierarchy of CouchbaseCacheTest

File

lib/doctrine/cache/tests/Doctrine/Tests/Common/Cache/CouchbaseCacheTest.php, line 8

Namespace

Doctrine\Tests\Common\Cache
View source
class CouchbaseCacheTest extends CacheTest {
  private $couchbase;
  public function setUp() {
    if (extension_loaded('couchbase')) {
      try {
        $this->couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default');
      } catch (Exception $ex) {
        $this
          ->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex);
      }
    }
    else {
      $this
        ->markTestSkipped('The ' . __CLASS__ . ' requires the use of the couchbase extension');
    }
  }
  public function testNoExpire() {
    $cache = $this
      ->_getCacheDriver();
    $cache
      ->save('noexpire', 'value', 0);
    sleep(1);
    $this
      ->assertTrue($cache
      ->contains('noexpire'), 'Couchbase provider should support no-expire');
  }
  public function testLongLifetime() {
    $cache = $this
      ->_getCacheDriver();
    $cache
      ->save('key', 'value', 30 * 24 * 3600 + 1);
    $this
      ->assertTrue($cache
      ->contains('key'), 'Couchbase provider should support TTL > 30 days');
  }
  protected function _getCacheDriver() {
    $driver = new CouchbaseCache();
    $driver
      ->setCouchbase($this->couchbase);
    return $driver;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheTest::falseCastedValuesProvider public function The following values get converted to FALSE if you cast them to a boolean.
CacheTest::isSharedStorage protected function Return whether multiple cache providers share the same storage. 3
CacheTest::provideCrudValues public function
CacheTest::testBasicCrudOperations public function @dataProvider provideCrudValues
CacheTest::testDeleteAll public function
CacheTest::testDeleteAllAndNamespaceVersioningBetweenCaches public function
CacheTest::testDeleteAllNamespace public function
CacheTest::testFalseCastedValues 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::testFetchMissShouldReturnFalse public function
CacheTest::testFetchMulti public function
CacheTest::testFetchMultiWillFilterNonRequestedKeys public function
CacheTest::testFlushAll public function
CacheTest::testFlushAllAndNamespaceVersioningBetweenCaches public function
CacheTest::testGetStats public function @group DCOM-43 8
CacheTest::testNamespace public function
CouchbaseCacheTest::$couchbase private property
CouchbaseCacheTest::setUp public function
CouchbaseCacheTest::testLongLifetime public function
CouchbaseCacheTest::testNoExpire public function
CouchbaseCacheTest::_getCacheDriver protected function Overrides CacheTest::_getCacheDriver