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 2
2
3
3
## Unreleased
4
4
5
+ ## Fixed
6
+
7
+ - FilteredStream::getSize returns null because the contents size is unknown.
8
+
5
9
### Deprecated
6
10
7
11
- 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()
39
39
40
40
$ this ->getContents ()->shouldReturn ("6 \r\nThis i \r\n6 \r\ns a st \r\n4 \r\nream \r\n0 \r\n\r\n" );
41
41
}
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
+ }
42
50
}
Original file line number Diff line number Diff line change @@ -41,4 +41,13 @@ function it_gets_content()
41
41
$ stream ->rewind ();
42
42
$ this ->getContents ()->shouldReturn (gzcompress ('This is a test stream ' ));
43
43
}
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
+ }
44
53
}
Original file line number Diff line number Diff line change @@ -40,4 +40,12 @@ function it_gets_content()
40
40
41
41
$ this ->getContents ()->shouldReturn ('test ' );
42
42
}
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
+ }
43
51
}
Original file line number Diff line number Diff line change @@ -41,4 +41,12 @@ function it_gets_content()
41
41
42
42
$ this ->getContents ()->shouldReturn ('This is a test stream ' );
43
43
}
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
+ }
44
52
}
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ function it_gets_content()
36
36
$ stream ->rewind ();
37
37
$ this ->getContents ()->shouldReturn (gzdeflate ('This is a test stream ' ));
38
38
}
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
+ }
39
47
}
Original file line number Diff line number Diff line change @@ -41,4 +41,12 @@ function it_gets_content()
41
41
42
42
$ this ->getContents ()->shouldReturn ('This is a test stream ' );
43
43
}
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
+ }
44
52
}
Original file line number Diff line number Diff line change @@ -41,4 +41,13 @@ function it_gets_content()
41
41
$ stream ->rewind ();
42
42
$ this ->getContents ()->shouldReturn (gzencode ('This is a test stream ' ));
43
43
}
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
+ }
44
53
}
Original file line number Diff line number Diff line change @@ -36,4 +36,12 @@ function it_gets_content()
36
36
37
37
$ this ->getContents ()->shouldReturn ('This is a test stream ' );
38
38
}
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
+ }
39
47
}
Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ public function getContents()
138
138
return $ buffer ;
139
139
}
140
140
141
+ /**
142
+ * {@inheritdoc}
143
+ */
144
+ public function getSize ()
145
+ {
146
+ return ;
147
+ }
148
+
141
149
/**
142
150
* {@inheritdoc}
143
151
*/
You can’t perform that action at this time.
0 commit comments