You are here

protected function BackendGeneralTestCase::checkExists in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Tests/Generic/Cache/BackendGeneralTestCase.php \Drupal\supercache\Tests\Generic\Cache\BackendGeneralTestCase::checkExists()

Check whether or not a WinCache entry exists.

Parameters

string $cid: The WinCache id.

string $var: The variable the cache should contain.

Return value

bool TRUE on pass, FALSE on fail.

4 calls to BackendGeneralTestCase::checkExists()
BackendClearTests::testClearArray in src/Tests/Generic/Cache/BackendClearTests.php
Test clearing using an array.
BackendClearTests::testClearCid in src/Tests/Generic/Cache/BackendClearTests.php
Test clearing using a cid.
BackendGeneralTestCase::assertExists in src/Tests/Generic/Cache/BackendGeneralTestCase.php
Assert or a entry exists.
BackendGetMultipleTests::testCacheMultiple in src/Tests/Generic/Cache/BackendGetMultipleTests.php
Test cache_get_multiple().

File

src/Tests/Generic/Cache/BackendGeneralTestCase.php, line 108

Class

BackendGeneralTestCase
Testea funciones basicas.

Namespace

Drupal\supercache\Tests\Generic\Cache

Code

protected function checkExists($cid, $var, $backend = NULL) {
  if (empty($backend)) {
    $backend = $this->backend;
  }
  $cache = $backend
    ->get($cid);
  return isset($cache->data) && $cache->data == $var;
}