4747use PHPUnit \Framework \Attributes \Group ;
4848use PHPUnit \Framework \Attributes \PreserveGlobalState ;
4949use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
50+ use PHPUnit \Framework \Attributes \WithoutErrorHandler ;
5051use stdClass ;
5152use Tests \Support \Models \JobModel ;
5253
@@ -274,25 +275,19 @@ public function testEscapeRecursiveArrayRaw(): void
274275
275276 #[PreserveGlobalState(false )]
276277 #[RunInSeparateProcess]
278+ #[WithoutErrorHandler]
277279 public function testSessionInstance (): void
278280 {
279- // Workaround for errors on PHPUnit 10 and PHP 8.3.
280- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
281- restore_error_handler ();
282-
283281 $ this ->injectSessionMock ();
284282
285283 $ this ->assertInstanceOf (Session::class, session ());
286284 }
287285
288286 #[PreserveGlobalState(false )]
289287 #[RunInSeparateProcess]
288+ #[WithoutErrorHandler]
290289 public function testSessionVariable (): void
291290 {
292- // Workaround for errors on PHPUnit 10 and PHP 8.3.
293- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
294- restore_error_handler ();
295-
296291 $ this ->injectSessionMock ();
297292
298293 $ _SESSION ['notbogus ' ] = 'Hi there ' ;
@@ -302,12 +297,9 @@ public function testSessionVariable(): void
302297
303298 #[PreserveGlobalState(false )]
304299 #[RunInSeparateProcess]
300+ #[WithoutErrorHandler]
305301 public function testSessionVariableNotThere (): void
306302 {
307- // Workaround for errors on PHPUnit 10 and PHP 8.3.
308- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
309- restore_error_handler ();
310-
311303 $ this ->injectSessionMock ();
312304
313305 $ _SESSION ['bogus ' ] = 'Hi there ' ;
@@ -428,12 +420,9 @@ public function testModelExistsAbsoluteClassname(): void
428420
429421 #[PreserveGlobalState(false )]
430422 #[RunInSeparateProcess]
423+ #[WithoutErrorHandler]
431424 public function testOldInput (): void
432425 {
433- // Workaround for errors on PHPUnit 10 and PHP 8.3.
434- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
435- restore_error_handler ();
436-
437426 $ this ->injectSessionMock ();
438427 // setup from RedirectResponseTest...
439428 $ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
@@ -465,12 +454,9 @@ public function testOldInput(): void
465454
466455 #[PreserveGlobalState(false )]
467456 #[RunInSeparateProcess]
457+ #[WithoutErrorHandler]
468458 public function testOldInputSerializeData (): void
469459 {
470- // Workaround for errors on PHPUnit 10 and PHP 8.3.
471- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
472- restore_error_handler ();
473-
474460 $ this ->injectSessionMock ();
475461 // setup from RedirectResponseTest...
476462 $ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
@@ -503,12 +489,9 @@ public function testOldInputSerializeData(): void
503489 */
504490 #[PreserveGlobalState(false )]
505491 #[RunInSeparateProcess]
492+ #[WithoutErrorHandler]
506493 public function testOldInputArray (): void
507494 {
508- // Workaround for errors on PHPUnit 10 and PHP 8.3.
509- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
510- restore_error_handler ();
511-
512495 $ this ->injectSessionMock ();
513496 // setup from RedirectResponseTest...
514497 $ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
@@ -622,12 +605,9 @@ public function testRedirectResponseCookies1(): void
622605
623606 #[PreserveGlobalState(false )]
624607 #[RunInSeparateProcess]
608+ #[WithoutErrorHandler]
625609 public function testTrace (): void
626610 {
627- // Workaround for errors on PHPUnit 10 and PHP 8.3.
628- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
629- restore_error_handler ();
630-
631611 ob_start ();
632612 trace ();
633613 $ content = ob_get_clean ();
@@ -647,12 +627,9 @@ public function testViewNotSaveData(): void
647627
648628 #[PreserveGlobalState(false )]
649629 #[RunInSeparateProcess]
630+ #[WithoutErrorHandler]
650631 public function testForceHttpsNullRequestAndResponse (): void
651632 {
652- // Workaround for errors on PHPUnit 10 and PHP 8.3.
653- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
654- restore_error_handler ();
655-
656633 $ this ->assertNull (Services::response ()->header ('Location ' ));
657634
658635 Services::response ()->setCookie ('force ' , 'cookie ' );
@@ -763,12 +740,9 @@ public function testDWithCSP(): void
763740
764741 #[PreserveGlobalState(false )]
765742 #[RunInSeparateProcess]
743+ #[WithoutErrorHandler]
766744 public function testTraceWithCSP (): void
767745 {
768- // Workaround for errors on PHPUnit 10 and PHP 8.3.
769- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
770- restore_error_handler ();
771-
772746 $ this ->resetServices ();
773747
774748 /** @var App $config */
@@ -780,11 +754,6 @@ public function testTraceWithCSP(): void
780754
781755 Kint::$ cli_detection = false ;
782756
783- // Workaround for errors on PHPUnit 10 and PHP 8.3.
784- // See https://github.com/sebastianbergmann/phpunit/issues/5403#issuecomment-1906810619
785- // `$app->initialize()` sets error handler.
786- restore_error_handler ();
787-
788757 $ this ->expectOutputRegex ('/<style class="kint-rich-style" nonce="[0-9a-z]{24}">/u ' );
789758 trace ();
790759 }
0 commit comments