function CacheSavingCase::checkVariable

Check or a variable is stored and restored properly.

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

File

modules/simpletest/tests/cache.test, line 157

Class

CacheSavingCase

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.