コード例 #1
0
ファイル: CommonAdapterTest.php プロジェクト: ninahuanca/zf2
 public function testCheckAndSetItem()
 {
     $this->assertTrue($this->_storage->setItem('key', 'value'));
     $success = null;
     $casToken = null;
     $this->assertEquals('value', $this->_storage->getItem('key', $success, $casToken));
     $this->assertNotNull($casToken);
     $this->assertTrue($this->_storage->checkAndSetItem($casToken, 'key', 'newValue'));
     $this->assertFalse($this->_storage->checkAndSetItem($casToken, 'key', 'failedValue'));
     $this->assertEquals('newValue', $this->_storage->getItem('key'));
 }
コード例 #2
0
 /**
  * @test
  */
 public function delegatesCheckAndSetItem()
 {
     $this->storage->checkAndSetItem('token', 'key', 'value')->willReturn(true);
     $return = $this->cache->checkAndSetItem('token', 'key', 'value');
     $this->assertTrue($return);
 }
コード例 #3
0
 public function checkAndSetItem($token, $key, $value)
 {
     return $this->storage->checkAndSetItem($token, $key, $value);
 }