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)
163163 return fread ($ this ->socket , $ length );
164164 }
165165
166- if ($ this ->getSize () < ($ this ->readed + $ length )) {
167- throw new StreamException ('Cannot read more than %s ' , $ this ->getSize () - $ this ->readed );
168- }
169-
170166 if ($ this ->getSize () === $ this ->readed ) {
171167 return '' ;
172168 }
Original file line number Diff line number Diff line change @@ -144,4 +144,14 @@ public function testClose()
144144
145145 $ this ->assertFalse (is_resource ($ socket ));
146146 }
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+ }
147157}
You can’t perform that action at this time.
0 commit comments