You are here

function MemCacheSavingCase::testIntegerValue in Memcache API and Integration 7

Test saving and restoring an integer value directly with dmemcache_set().

File

tests/memcache.test, line 334
Test cases for the memcache cache backend.

Class

MemCacheSavingCase

Code

function testIntegerValue() {
  $key = $this
    ->randomName(100);
  $val = rand(1, 1000);
  dmemcache_set($key, $val, 0, 'cache');
  $cache = dmemcache_get($key, 'cache');
  $this
    ->assertTrue($val === $cache, t('Integer is saved and restored properly with key @key', array(
    '@key' => $key,
  )));
}