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:----Z3Zj1q9l/D9oPN+VTVBf8E9uP/T2RwiKFyY5m9cTfscKvtTwwXBRLPuBwleKj+TW82Dhqaexle9dX1OR5z0Qio/KNDCy5BjZsEtsc0neGMWhuqbJLkk7yeDPm43e6SkbWJMemBDAdqrXjGjW2rVP78UoWcQ5XF9BoZKp8WJVoyiv3uhzAK6iuZ4x47BdLXmNX17Dy0gom9+sAWgPtGjWEQxvvUYZsR5wnRM1klxJwWA+2WjSTlFLVFZx9AV6dqjy1sm/Xlm5MIuGOsAsDKwNeara0oPmtcmuOZWxTux2Ffe+Y6ZzEwI5sIRP247avTrTS+BePsM3J4GkY4G6W0GNt0mODHZ2FlG8f/olStDWkRfFXXE8lORaC6RGhUZRExJf3FxY1fI04zbTyTc8U2/jdvCfSQCIAQF1kuGEXnh7rqtkLvqcwqqhf6hsUIcVh7iTSmG6rdUMOhkXvE1/e6yji2dJ2MZV4N5uzISjzCYjZyzlW4zykGcJGegyOgArSMeLijtEFvTFK0QR7lqB3qggA4rpH2TA3b7h1O/9MHbUQcNg8tIY/3waxFpDIzKzbbSOxfb44inP+cENKdBFbx2kpUMcACV7HqsJqbyPeBoC9N8QVo2NaMCpYNhFi8jDTgppP9LxHmeERv8jpLPTvMWlQ4oZpSBfkt9YICWkt1Tw1Es=----ATTACHMENT:----MjU0Mjc2NDAxOTk4MTE2OSAyODY4MTk3MDQ2NzE5OTk0IDIwMjU1NzI5NjM2MzcyMjY=