File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,13 @@ public function testIconPathOption() : void
211211 );
212212 }
213213
214+ protected function closeBuffer () : void
215+ {
216+ if (\ob_get_level ()) {
217+ \ob_end_clean ();
218+ }
219+ }
220+
214221 public function testInvalidIconPathOption () : void
215222 {
216223 $ iconPath = __DIR__ . '/not-found.png ' ;
@@ -223,9 +230,7 @@ public function testInvalidIconPathOption() : void
223230 $ e ->getMessage ()
224231 );
225232 }
226- if (\ob_get_level ()) {
227- \ob_end_clean ();
228- }
233+ $ this ->closeBuffer ();
229234 }
230235
231236 public function testInfoLinkOption () : void
@@ -250,9 +255,7 @@ public function testInvalidInfoLinkOption() : void
250255 $ e ->getMessage ()
251256 );
252257 }
253- if (\ob_get_level ()) {
254- \ob_end_clean ();
255- }
258+ $ this ->closeBuffer ();
256259 $ this ->debugger ->setOption ('info_link ' , [
257260 'href ' => '# ' ,
258261 ]);
@@ -264,9 +267,7 @@ public function testInvalidInfoLinkOption() : void
264267 $ e ->getMessage ()
265268 );
266269 }
267- if (\ob_get_level ()) {
268- \ob_end_clean ();
269- }
270+ $ this ->closeBuffer ();
270271 $ this ->debugger ->setOption ('info_link ' , [
271272 'text ' => '# ' ,
272273 ]);
@@ -278,9 +279,7 @@ public function testInvalidInfoLinkOption() : void
278279 $ e ->getMessage ()
279280 );
280281 }
281- if (\ob_get_level ()) {
282- \ob_end_clean ();
283- }
282+ $ this ->closeBuffer ();
284283 $ this ->debugger ->setOption ('info_link ' , [
285284 'href ' => 'https://foo.com ' ,
286285 'text ' => 'Foo Website ' ,
You can’t perform that action at this time.
0 commit comments