You are here

function ApcCacheSavingCase::checkVariable in APC - Alternative PHP Cache 7

Check or a variable is stored and restored properly.

4 calls to ApcCacheSavingCase::checkVariable()
ApcCacheSavingCase::testArray in tests/apc.test
Test the saving and restoring of an array.
ApcCacheSavingCase::testDouble in tests/apc.test
Test the saving and restoring of a double.
ApcCacheSavingCase::testInteger in tests/apc.test
Test the saving and restoring of an integer.
ApcCacheSavingCase::testString in tests/apc.test
Test the saving and restoring of a string.

File

tests/apc.test, line 167

Class

ApcCacheSavingCase

Code

function checkVariable($var) {
  cache_set('test_var', $var, $this->default_bin);
  $cache = cache_get('test_var', $this->default_bin);
  $this
    ->assertTrue(isset($cache->data) && $cache->data === $var, t('@type is saved and restored properly.', array(
    '@type' => ucfirst(gettype($var)),
  )));
}