@@ -58,7 +58,6 @@ public function testRegisterAddsAppropriateFilter() : void {
58
58
);
59
59
}
60
60
61
- #[RunInSeparateProcess]
62
61
public function testInterceptAddsBuffers () : void {
63
62
StreamFilter::register ();
64
63
@@ -71,7 +70,6 @@ public function testInterceptAddsBuffers() : void {
71
70
self ::assertContainsEquals ($ buffer , $ buffers );
72
71
}
73
72
74
- #[RunInSeparateProcess]
75
73
public function testResetAllResetsBuffersToEmptyCollection () : void {
76
74
StreamFilter::register ();
77
75
@@ -87,7 +85,6 @@ public function testResetAllResetsBuffersToEmptyCollection() : void {
87
85
88
86
}
89
87
90
- #[RunInSeparateProcess]
91
88
public function testWritingToInterceptedStreamAddedToCorrectOutput () : void {
92
89
StreamFilter::register ();
93
90
@@ -101,7 +98,6 @@ public function testWritingToInterceptedStreamAddedToCorrectOutput() : void {
101
98
);
102
99
}
103
100
104
- #[RunInSeparateProcess]
105
101
public function testResetIndividualBufferClearsToEmptyString () : void {
106
102
StreamFilter::register ();
107
103
@@ -116,7 +112,6 @@ public function testResetIndividualBufferClearsToEmptyString() : void {
116
112
self ::assertSame ('' , $ buffer ->output ());
117
113
}
118
114
119
- #[RunInSeparateProcess]
120
115
public function testStopInterceptingRemovesBufferedResourceFromCache () : void {
121
116
StreamFilter::register ();
122
117
@@ -129,7 +124,6 @@ public function testStopInterceptingRemovesBufferedResourceFromCache() : void {
129
124
self ::assertSame ([], StreamFilter::buffers ());
130
125
}
131
126
132
- #[RunInSeparateProcess]
133
127
public function testStopInterceptingBufferIdentifierNotFoundThrowsException () : void {
134
128
StreamFilter::register ();
135
129
@@ -142,7 +136,6 @@ public function testStopInterceptingBufferIdentifierNotFoundThrowsException() :
142
136
$ buffer ->stopIntercepting ();
143
137
}
144
138
145
- #[RunInSeparateProcess]
146
139
public function testOutputForBufferStoppedInterceptingThrowsException () : void {
147
140
StreamFilter::register ();
148
141
@@ -156,7 +149,6 @@ public function testOutputForBufferStoppedInterceptingThrowsException() : void {
156
149
$ buffer ->output ();
157
150
}
158
151
159
- #[RunInSeparateProcess]
160
152
public function testResetForBufferNotFoundThrowsException () : void {
161
153
StreamFilter::register ();
162
154
@@ -170,7 +162,6 @@ public function testResetForBufferNotFoundThrowsException() : void {
170
162
$ buffer ->reset ();
171
163
}
172
164
173
- #[RunInSeparateProcess]
174
165
public function testInterceptOptionsDefaultDoesNotHaveContentsInResource () : void {
175
166
StreamFilter::register ();
176
167
@@ -184,7 +175,6 @@ public function testInterceptOptionsDefaultDoesNotHaveContentsInResource() : voi
184
175
self ::assertSame ('' , stream_get_contents ($ this ->resource ));
185
176
}
186
177
187
- #[RunInSeparateProcess]
188
178
public function testInterceptOptionsTrapDoesNotHaveContentsInResource () : void {
189
179
StreamFilter::register ();
190
180
@@ -198,7 +188,6 @@ public function testInterceptOptionsTrapDoesNotHaveContentsInResource() : void {
198
188
self ::assertSame ('' , stream_get_contents ($ this ->resource ));
199
189
}
200
190
201
- #[RunInSeparateProcess]
202
191
public function testInterceptOptionsPassThruDoesHaveContentsInResource () : void {
203
192
StreamFilter::register ();
204
193
@@ -212,7 +201,6 @@ public function testInterceptOptionsPassThruDoesHaveContentsInResource() : void
212
201
self ::assertSame ('Content written to stream ' , stream_get_contents ($ this ->resource ));
213
202
}
214
203
215
- #[RunInSeparateProcess]
216
204
public function testInterceptOptionsFatalErrorThrowsError () : void {
217
205
StreamFilter::register ();
218
206
@@ -226,7 +214,6 @@ public function testInterceptOptionsFatalErrorThrowsError() : void {
226
214
self ::assertSame ('' , stream_get_contents ($ this ->resource ));
227
215
}
228
216
229
- #[RunInSeparateProcess]
230
217
public function testWritingToSeparateStreams () : void {
231
218
StreamFilter::register ();
232
219
@@ -240,4 +227,18 @@ public function testWritingToSeparateStreams() : void {
240
227
self ::assertSame ('stdout output ' , $ stdout ->output ());
241
228
}
242
229
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
+
243
244
}
0 commit comments