@@ -58,7 +58,6 @@ public function testRegisterAddsAppropriateFilter() : void {
5858 );
5959 }
6060
61- #[RunInSeparateProcess]
6261 public function testInterceptAddsBuffers () : void {
6362 StreamFilter::register ();
6463
@@ -71,7 +70,6 @@ public function testInterceptAddsBuffers() : void {
7170 self ::assertContainsEquals ($ buffer , $ buffers );
7271 }
7372
74- #[RunInSeparateProcess]
7573 public function testResetAllResetsBuffersToEmptyCollection () : void {
7674 StreamFilter::register ();
7775
@@ -87,7 +85,6 @@ public function testResetAllResetsBuffersToEmptyCollection() : void {
8785
8886 }
8987
90- #[RunInSeparateProcess]
9188 public function testWritingToInterceptedStreamAddedToCorrectOutput () : void {
9289 StreamFilter::register ();
9390
@@ -101,7 +98,6 @@ public function testWritingToInterceptedStreamAddedToCorrectOutput() : void {
10198 );
10299 }
103100
104- #[RunInSeparateProcess]
105101 public function testResetIndividualBufferClearsToEmptyString () : void {
106102 StreamFilter::register ();
107103
@@ -116,7 +112,6 @@ public function testResetIndividualBufferClearsToEmptyString() : void {
116112 self ::assertSame ('' , $ buffer ->output ());
117113 }
118114
119- #[RunInSeparateProcess]
120115 public function testStopInterceptingRemovesBufferedResourceFromCache () : void {
121116 StreamFilter::register ();
122117
@@ -129,7 +124,6 @@ public function testStopInterceptingRemovesBufferedResourceFromCache() : void {
129124 self ::assertSame ([], StreamFilter::buffers ());
130125 }
131126
132- #[RunInSeparateProcess]
133127 public function testStopInterceptingBufferIdentifierNotFoundThrowsException () : void {
134128 StreamFilter::register ();
135129
@@ -142,7 +136,6 @@ public function testStopInterceptingBufferIdentifierNotFoundThrowsException() :
142136 $ buffer ->stopIntercepting ();
143137 }
144138
145- #[RunInSeparateProcess]
146139 public function testOutputForBufferStoppedInterceptingThrowsException () : void {
147140 StreamFilter::register ();
148141
@@ -156,7 +149,6 @@ public function testOutputForBufferStoppedInterceptingThrowsException() : void {
156149 $ buffer ->output ();
157150 }
158151
159- #[RunInSeparateProcess]
160152 public function testResetForBufferNotFoundThrowsException () : void {
161153 StreamFilter::register ();
162154
@@ -170,7 +162,6 @@ public function testResetForBufferNotFoundThrowsException() : void {
170162 $ buffer ->reset ();
171163 }
172164
173- #[RunInSeparateProcess]
174165 public function testInterceptOptionsDefaultDoesNotHaveContentsInResource () : void {
175166 StreamFilter::register ();
176167
@@ -184,7 +175,6 @@ public function testInterceptOptionsDefaultDoesNotHaveContentsInResource() : voi
184175 self ::assertSame ('' , stream_get_contents ($ this ->resource ));
185176 }
186177
187- #[RunInSeparateProcess]
188178 public function testInterceptOptionsTrapDoesNotHaveContentsInResource () : void {
189179 StreamFilter::register ();
190180
@@ -198,7 +188,6 @@ public function testInterceptOptionsTrapDoesNotHaveContentsInResource() : void {
198188 self ::assertSame ('' , stream_get_contents ($ this ->resource ));
199189 }
200190
201- #[RunInSeparateProcess]
202191 public function testInterceptOptionsPassThruDoesHaveContentsInResource () : void {
203192 StreamFilter::register ();
204193
@@ -212,7 +201,6 @@ public function testInterceptOptionsPassThruDoesHaveContentsInResource() : void
212201 self ::assertSame ('Content written to stream ' , stream_get_contents ($ this ->resource ));
213202 }
214203
215- #[RunInSeparateProcess]
216204 public function testInterceptOptionsFatalErrorThrowsError () : void {
217205 StreamFilter::register ();
218206
@@ -226,7 +214,6 @@ public function testInterceptOptionsFatalErrorThrowsError() : void {
226214 self ::assertSame ('' , stream_get_contents ($ this ->resource ));
227215 }
228216
229- #[RunInSeparateProcess]
230217 public function testWritingToSeparateStreams () : void {
231218 StreamFilter::register ();
232219
@@ -240,4 +227,18 @@ public function testWritingToSeparateStreams() : void {
240227 self ::assertSame ('stdout output ' , $ stdout ->output ());
241228 }
242229
230+ public function testInterceptingStoppingAndStartingAgainDoesNotResultInNullPointer () : void {
231+ StreamFilter::register ();
232+
233+ $ buffer = StreamFilter::intercept ($ this ->resource );
234+ $ buffer ->stopIntercepting ();
235+
236+ $ buffer = StreamFilter::intercept ($ this ->resource );
237+ fwrite ($ this ->resource , 'Some content ' );
238+
239+ self ::assertSame ('Some content ' , $ buffer ->output ());
240+
241+ $ buffer ->stopIntercepting ();
242+ }
243+
243244}
0 commit comments