public function testCopiesToStringStopsWhenReadFailsWithMaxLen() { $s1 = puzzle_stream_Stream::factory('foobaz'); $s1 = puzzle_stream_FnStream::decorate($s1, array('read' => array($this, '__callback_returnEmpty'))); $result = puzzle_stream_Utils::copyToString($s1, 10); $this->assertEquals('', $result); }
/** * @deprecated Moved to puzzle_stream_Utils::copyToString */ function puzzle_stream_copy_to_string(puzzle_stream_StreamInterface $stream, $maxLen = -1) { return puzzle_stream_Utils::copyToString($stream, $maxLen); }
public function getContents($maxLength = -1) { return puzzle_stream_Utils::copyToString($this, $maxLength); }