Esempio n. 1
0
 public function testCheckAndSetItem()
 {
     $this->assertTrue($this->_storage->setItem('key', 'value'));
     $token = null;
     $this->assertEquals('value', $this->_storage->getItem('key', array('token' => &$token)));
     $this->assertNotNull($token);
     $this->assertTrue($this->_storage->checkAndSetItem($token, 'key', 'newValue'));
     $this->assertFalse($this->_storage->checkAndSetItem($token, 'key', 'failedValue'));
     $this->assertEquals('newValue', $this->_storage->getItem('key'));
 }