Example #1
0
 public function testIncrementItemReturnsFalseIfNonWritable()
 {
     $this->_storage->setItem('key', 10);
     $this->_options->setWritable(false);
     $this->assertFalse($this->_storage->incrementItem('key', 5));
     $this->assertEquals(10, $this->_storage->getItem('key'));
 }
 public function incrementItem($key, $value)
 {
     if ($this->itemIsUnderConstruction($key)) {
         $this->waitForItem($key);
     }
     return $this->storage->incrementItem($key, $value);
 }
 /**
  * @test
  */
 public function delegatesIncrementItem()
 {
     $this->storage->hasItem($this->delayedKey)->willReturn(false);
     $this->storage->incrementItem('foo', 'increment')->willReturn(true);
     $return = $this->cache->incrementItem('foo', 'increment');
     $this->assertTrue($return);
 }
Example #4
0
 /**
  * {@inheritdoc}
  *
  * @see \Cerberus\CerberusInterface::reportFailure()
  */
 public function reportFailure($serviceName = null)
 {
     $this->setNamespace($serviceName);
     $this->storage->incrementItem('failures', 1);
 }