Exemple #1
0
 public function testRedisCacheStore()
 {
     $key = 'singleKey';
     //assure that there's nothing under key
     $this->_storage->removeItem($key);
     $this->assertNull($this->_storage->getItem($key));
     $this->_storage->setItem($key, serialize(array('test', array('one', 'two'))));
     $this->assertCount(2, unserialize($this->_storage->getItem($key)), 'Get item should return array of two elements');
     $expectedVals = array('key1' => 'val1', 'key2' => 'val2', 'key3' => array('val3', 'val4'));
     $this->_storage->setItems($expectedVals);
     $this->assertCount(3, $this->_storage->getItems(array_keys($expectedVals)), 'Multiple set/get items didnt save correct amount of rows');
 }