File tree Expand file tree Collapse file tree 10 files changed +78
-0
lines changed Expand file tree Collapse file tree 10 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 33
44## Unreleased
55
6+ ## Fixed
7+
8+ - FilteredStream::getSize returns null because the contents size is unknown.
9+
610### Deprecated
711
812 - FilteredStream::getReadFilter The read filter is internal and should never be used by consuming code.
Original file line number Diff line number Diff line change @@ -39,4 +39,12 @@ function it_chunks_in_multiple()
3939
4040 $ this ->getContents ()->shouldReturn ("6 \r\nThis i \r\n6 \r\ns a st \r\n4 \r\nream \r\n0 \r\n\r\n" );
4141 }
42+
43+ function it_does_not_know_the_content_size ()
44+ {
45+ $ stream = new MemoryStream ('This is a stream ' );
46+ $ this ->beConstructedWith ($ stream , 6 );
47+
48+ $ this ->getSize ()->shouldReturn (null );
49+ }
4250}
Original file line number Diff line number Diff line change @@ -41,4 +41,13 @@ function it_gets_content()
4141 $ stream ->rewind ();
4242 $ this ->getContents ()->shouldReturn (gzcompress ('This is a test stream ' ));
4343 }
44+
45+ function it_does_not_know_the_content_size ()
46+ {
47+ $ stream = new MemoryStream ('This is a test stream ' );
48+ $ this ->beConstructedWith ($ stream );
49+
50+ $ stream ->rewind ();
51+ $ this ->getSize ()->shouldReturn (null );
52+ }
4453}
Original file line number Diff line number Diff line change @@ -40,4 +40,12 @@ function it_gets_content()
4040
4141 $ this ->getContents ()->shouldReturn ('test ' );
4242 }
43+
44+ function it_does_not_know_the_content_size ()
45+ {
46+ $ stream = new MemoryStream ("4 \r\ntest \r\n4 \r\ntest \r\n0 \r\n\r\n\0" );
47+ $ this ->beConstructedWith ($ stream );
48+
49+ $ this ->getSize ()->shouldReturn (null );
50+ }
4351}
Original file line number Diff line number Diff line change @@ -41,4 +41,12 @@ function it_gets_content()
4141
4242 $ this ->getContents ()->shouldReturn ('This is a test stream ' );
4343 }
44+
45+ function it_does_not_know_the_content_size ()
46+ {
47+ $ stream = new MemoryStream (gzcompress ('This is a test stream ' ));
48+ $ this ->beConstructedWith ($ stream );
49+
50+ $ this ->getSize ()->shouldReturn (null );
51+ }
4452}
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ function it_gets_content()
3636 $ stream ->rewind ();
3737 $ this ->getContents ()->shouldReturn (gzdeflate ('This is a test stream ' ));
3838 }
39+
40+ function it_does_not_know_the_content_size ()
41+ {
42+ $ stream = new MemoryStream ('This stream is a test stream ' );
43+ $ this ->beConstructedWith ($ stream );
44+
45+ $ this ->getSize ()->shouldReturn (null );
46+ }
3947}
Original file line number Diff line number Diff line change @@ -41,4 +41,12 @@ function it_gets_content()
4141
4242 $ this ->getContents ()->shouldReturn ('This is a test stream ' );
4343 }
44+
45+ function it_does_not_know_the_content_size ()
46+ {
47+ $ stream = new MemoryStream (gzencode ('This is a test stream ' ));
48+ $ this ->beConstructedWith ($ stream );
49+
50+ $ this ->getSize ()->shouldReturn (null );
51+ }
4452}
Original file line number Diff line number Diff line change @@ -41,4 +41,13 @@ function it_gets_content()
4141 $ stream ->rewind ();
4242 $ this ->getContents ()->shouldReturn (gzencode ('This is a test stream ' ));
4343 }
44+
45+ function it_does_not_know_the_content_size ()
46+ {
47+ $ stream = new MemoryStream ('This is a test stream ' );
48+ $ this ->beConstructedWith ($ stream );
49+
50+ $ stream ->rewind ();
51+ $ this ->getSize ()->shouldReturn (null );
52+ }
4453}
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ function it_gets_content()
3636
3737 $ this ->getContents ()->shouldReturn ('This is a test stream ' );
3838 }
39+
40+ function it_does_not_know_the_content_size ()
41+ {
42+ $ stream = new MemoryStream (gzdeflate ('This stream is a test stream ' ));
43+ $ this ->beConstructedWith ($ stream );
44+
45+ $ this ->getSize ()->shouldReturn (null );
46+ }
3947}
Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ public function getContents()
138138 return $ buffer ;
139139 }
140140
141+ /**
142+ * {@inheritdoc}
143+ */
144+ public function getSize ()
145+ {
146+ return ;
147+ }
148+
141149 /**
142150 * {@inheritdoc}
143151 */
You can’t perform that action at this time.
0 commit comments