File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,6 @@ public function read($length)
163
163
return fread ($ this ->socket , $ length );
164
164
}
165
165
166
- if ($ this ->getSize () < ($ this ->readed + $ length )) {
167
- throw new StreamException ('Cannot read more than %s ' , $ this ->getSize () - $ this ->readed );
168
- }
169
-
170
166
if ($ this ->getSize () === $ this ->readed ) {
171
167
return '' ;
172
168
}
Original file line number Diff line number Diff line change @@ -144,4 +144,14 @@ public function testClose()
144
144
145
145
$ this ->assertFalse (is_resource ($ socket ));
146
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
+ }
147
157
}
You can’t perform that action at this time.
0 commit comments