/** * @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); }
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')); }
public function decrementItem($key, $value) { if ($this->itemIsUnderConstruction($key)) { $this->waitForItem($key); } return $this->storage->decrementItem($key, $value); }