/**
  * @test
  */
 public function delegatesDecrementItem()
 {
     $this->storage->hasItem($this->delayedKey)->willReturn(false);
     $this->storage->decrementItem('foo', 'decrement')->willReturn(true);
     $return = $this->cache->decrementItem('foo', 'decrement');
     $this->assertTrue($return);
 }
示例#2
0
 public function testDecrementItemReturnsFalseIfNonWritable()
 {
     $this->_storage->setItem('key', 10);
     $this->_options->setWritable(false);
     $this->assertFalse($this->_storage->decrementItem('key', 5));
     $this->assertEquals(10, $this->_storage->getItem('key'));
 }
示例#3
0
 public function decrementItem($key, $value)
 {
     if ($this->itemIsUnderConstruction($key)) {
         $this->waitForItem($key);
     }
     return $this->storage->decrementItem($key, $value);
 }