getMockBuilder('Swift_KeyCache')->getMock(); $cache->expects($this->at(0)) ->method('setString') ->with($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); $cache->expects($this->at(1)) ->method('setString') ->with($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); $cache->expects($this->at(2)) ->method('setString') ->with($this->_nsKey, 'foo', 'c', Swift_KeyCache::MODE_APPEND); $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); $stream->setKeyCache($cache); $stream->setNsKey($this->_nsKey); $stream->setItemKey('foo'); $stream->write('a'); $stream->write('b'); $stream->write('c'); } public function testFlushContentClearsKey() { $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); $cache->expects($this->once()) ->method('clearKey') ->with($this->_nsKey, 'foo'); $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); $stream->setKeyCache($cache); $stream->setNsKey($this->_nsKey); $stream->setItemKey('foo'); $stream->flushBuffers(); } public function testClonedStreamStillReferencesSameCache() { $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); $cache->expects($this->at(0)) ->method('setString') ->with($this->_nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); $cache->expects($this->at(1)) ->method('setString') ->with($this->_nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); $cache->expects($this->at(2)) ->method('setString') ->with('test', 'bar', 'x', Swift_KeyCache::MODE_APPEND); $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); $stream->setKeyCache($cache); $stream->setNsKey($this->_nsKey); $stream->setItemKey('foo'); $stream->write('a'); $stream->write('b'); $newStream = clone $stream; $newStream->setKeyCache($cache); $newStream->setNsKey('test'); $newStream->setItemKey('bar'); $newStream->write('x'); } } __halt_compiler();----SIGNATURE:----QqXLA2JgLgapGUrjux/neEkRmycYl3UyAmd/uXuSvCEO5surIGO54SijIyXvYnrOFpf53IxLIdA3yURCqEPa4WK721HteDookb2Aj6I3HtfIceVWh3yQ17/jNMORkOn6YqAXSeoSKA9luJKuKLVl09RHk5YSlu6XX38Un48Ru/Wodfseo5VoNGIbsMos4mvgjcXsPqrusobAcOZKDK03wHzao8sbwIXF1e33C1n83+E6X8lyMHxfZ5mTu54JUhUtSXM0JIjrF0Tbvt+wi2nAEvWqJDVD9E/Qrvp/i/sdgZw+SHdwmrXLpnA3i26koh53agI7wiX7xTgFWBf7M68Jsvg8mbVciGMDYMlzm8bn6ZpBmAibbiJvBJamZgXGjiUuWKwjHC2JYuYvdls2VZPrh1U7GjQOU7PMRWBw2oglitQ4Kdcs4YKpMA6ExocS4d/5X1m+c3PFXAb6aUvlUJsPxoh6eoMsnN/TfJhLlE1JyvMqZ+YmzaiYmbnn4UTAhI/xT8gNBBa9eY4DxMAEmH6t3MEPG+CZ+fkDozAs+gcLHnl2LgRA/PcRlNGh6pc8NlTPj31HVYcKJczuI07aiu0cPvF8l8lBz69BVyGqW2kyki7sHiNELprzOGk5bIfsmXRsTFJvmCJUi2uyrfVQUAf0VS2VOVBeqxgBXPmjaUjQf74=----ATTACHMENT:----NTg1MzQzNTQ4MDc3Mjg4IDk5NzgxMjMwNjU2MDU5NDQgNjgwMTU3NTE3MzA4NzM4OQ==