You are here

function MemCacheSavingCase::checkVariable in Zircon Profile 8

Same name in this branch
  1. 8 modules/memcache/tests/memcache.test \MemCacheSavingCase::checkVariable()
  2. 8 modules/memcache/tests/memcache6.test \MemCacheSavingCase::checkVariable()
Same name and namespace in other branches
  1. 8.0 modules/memcache/tests/memcache.test \MemCacheSavingCase::checkVariable()
  2. 8.0 modules/memcache/tests/memcache6.test \MemCacheSavingCase::checkVariable()
10 calls to MemCacheSavingCase::checkVariable()
MemCacheSavingCase::testArray in modules/memcache/tests/memcache.test
Test the saving and restoring of an array.
MemCacheSavingCase::testArray in modules/memcache/tests/memcache6.test
Test the saving and restoring of an array.
MemCacheSavingCase::testDouble in modules/memcache/tests/memcache.test
Test the saving and restoring of a double.
MemCacheSavingCase::testDouble in modules/memcache/tests/memcache6.test
Test the saving and restoring of a double.
MemCacheSavingCase::testInteger in modules/memcache/tests/memcache.test
Test the saving and restoring of an integer.

... See full list

File

modules/memcache/tests/memcache.test, line 178

Class

MemCacheSavingCase

Code

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