1 cache.test CacheSavingCase::checkVariable($var)

Check or a variable is stored and restored properly.

File

core/modules/simpletest/tests/cache.test, line 139

Class

CacheSavingCase

Code

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