We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ea4b321 + bbfaa46 commit aca53b9Copy full SHA for aca53b9
src/Stream.php
@@ -163,10 +163,6 @@ public function read($length)
163
return fread($this->socket, $length);
164
}
165
166
- if ($this->getSize() < ($this->readed + $length)) {
167
- throw new StreamException('Cannot read more than %s', $this->getSize() - $this->readed);
168
- }
169
-
170
if ($this->getSize() === $this->readed) {
171
return '';
172
tests/StreamTest.php
@@ -144,4 +144,14 @@ public function testClose()
144
145
$this->assertFalse(is_resource($socket));
146
147
+
148
+ public function testRead()
149
+ {
150
+ $stream = $this->createSocket("Body");
151
152
+ $this->assertEquals("Bod", $stream->read(3));
153
+ $this->assertEquals("y", $stream->read(3));
154
155
+ $stream->close();
156
+ }
157
0 commit comments