public function testReplaceItemsFail() { $options = array('ttl' => 123); $items = array('key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'); // replace -> has -> get -> set $this->_storage->expects($this->exactly(count($items)))->method('getItem')->with($this->stringContains('key'), $this->equalTo($options))->will($this->returnValue(true)); $this->_storage->expects($this->exactly(count($items)))->method('setItem')->with($this->stringContains('key'), $this->stringContains('value'), $this->equalTo($options))->will($this->returnValue(false)); $this->assertFalse($this->_storage->replaceItems($items, $options)); }