1212use PhpMyAdmin \ResponseRenderer ;
1313use PhpMyAdmin \Tests \AbstractTestCase ;
1414use PhpMyAdmin \Tests \Stubs \ResponseRenderer as ResponseRendererStub ;
15- use PHPUnit \Framework \Attributes \BackupStaticProperties ;
1615use PHPUnit \Framework \Attributes \CoversClass ;
1716use PHPUnit \Framework \Attributes \DataProvider ;
1817use PHPUnit \Framework \Attributes \Group ;
1918use PHPUnit \Framework \Attributes \Medium ;
19+ use PHPUnit \Framework \Attributes \PreserveGlobalState ;
20+ use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
2021use ReflectionException ;
2122use ReflectionMethod ;
2223use ReflectionProperty ;
@@ -78,7 +79,8 @@ protected function tearDown(): void
7879 }
7980
8081 #[Group('medium ' )]
81- #[BackupStaticProperties(true )]
82+ #[RunInSeparateProcess]
83+ #[PreserveGlobalState(false )]
8284 public function testAuthErrorAJAX (): void
8385 {
8486 $ GLOBALS ['conn_error ' ] = true ;
@@ -116,7 +118,8 @@ private function getAuthErrorMockResponse(): void
116118 ErrorHandler::$ instance = $ mockErrorHandler ;
117119 }
118120
119- #[BackupStaticProperties(true )]
121+ #[RunInSeparateProcess]
122+ #[PreserveGlobalState(false )]
120123 #[Group('medium ' )]
121124 public function testAuthError (): void
122125 {
@@ -192,7 +195,8 @@ public function testAuthError(): void
192195 $ this ->assertStringContainsString ('<input type="hidden" name="table" value="testTable"> ' , $ result );
193196 }
194197
195- #[BackupStaticProperties(true )]
198+ #[RunInSeparateProcess]
199+ #[PreserveGlobalState(false )]
196200 #[Group('medium ' )]
197201 public function testAuthCaptcha (): void
198202 {
@@ -254,7 +258,8 @@ public function testAuthCaptcha(): void
254258 );
255259 }
256260
257- #[BackupStaticProperties(true )]
261+ #[RunInSeparateProcess]
262+ #[PreserveGlobalState(false )]
258263 #[Group('medium ' )]
259264 public function testAuthCaptchaCheckbox (): void
260265 {
@@ -318,7 +323,8 @@ public function testAuthCaptchaCheckbox(): void
318323 );
319324 }
320325
321- #[BackupStaticProperties(true )]
326+ #[RunInSeparateProcess]
327+ #[PreserveGlobalState(false )]
322328 public function testAuthHeader (): void
323329 {
324330 $ config = Config::getInstance ();
@@ -338,7 +344,8 @@ public function testAuthHeader(): void
338344 $ this ->assertSame (302 , $ response ->getStatusCode ());
339345 }
340346
341- #[BackupStaticProperties(true )]
347+ #[RunInSeparateProcess]
348+ #[PreserveGlobalState(false )]
342349 public function testAuthHeaderPartial (): void
343350 {
344351 $ config = Config::getInstance ();
@@ -381,7 +388,8 @@ public function testAuthCheckCaptcha(): void
381388 );
382389 }
383390
384- #[BackupStaticProperties(true )]
391+ #[RunInSeparateProcess]
392+ #[PreserveGlobalState(false )]
385393 public function testLogoutDelete (): void
386394 {
387395 $ responseStub = new ResponseRendererStub ();
@@ -409,7 +417,8 @@ public function testLogoutDelete(): void
409417 $ this ->assertArrayNotHasKey ('pmaAuth-0 ' , $ _COOKIE );
410418 }
411419
412- #[BackupStaticProperties(true )]
420+ #[RunInSeparateProcess]
421+ #[PreserveGlobalState(false )]
413422 public function testLogout (): void
414423 {
415424 $ responseStub = new ResponseRendererStub ();
@@ -666,7 +675,8 @@ public function testAuthSetUserWithHeaders(): void
666675 $ this ->object ->rememberCredentials ();
667676 }
668677
669- #[BackupStaticProperties(true )]
678+ #[RunInSeparateProcess]
679+ #[PreserveGlobalState(false )]
670680 public function testAuthFailsNoPass (): void
671681 {
672682 $ this ->object = $ this ->getMockBuilder (AuthenticationCookie::class)
@@ -741,7 +751,8 @@ public function testAuthFailsTooLongPass(string $password, bool $trueFalse, stri
741751 $ this ->assertEquals ($ GLOBALS ['conn_error ' ], $ connError );
742752 }
743753
744- #[BackupStaticProperties(true )]
754+ #[RunInSeparateProcess]
755+ #[PreserveGlobalState(false )]
745756 public function testAuthFailsDeny (): void
746757 {
747758 $ this ->object = $ this ->getMockBuilder (AuthenticationCookie::class)
@@ -773,7 +784,8 @@ public function testAuthFailsDeny(): void
773784 $ this ->assertEquals ($ GLOBALS ['conn_error ' ], 'Access denied! ' );
774785 }
775786
776- #[BackupStaticProperties(true )]
787+ #[RunInSeparateProcess]
788+ #[PreserveGlobalState(false )]
777789 public function testAuthFailsActivity (): void
778790 {
779791 $ this ->object = $ this ->getMockBuilder (AuthenticationCookie::class)
@@ -812,7 +824,8 @@ public function testAuthFailsActivity(): void
812824 );
813825 }
814826
815- #[BackupStaticProperties(true )]
827+ #[RunInSeparateProcess]
828+ #[PreserveGlobalState(false )]
816829 public function testAuthFailsDBI (): void
817830 {
818831 $ this ->object = $ this ->getMockBuilder (AuthenticationCookie::class)
@@ -855,7 +868,8 @@ public function testAuthFailsDBI(): void
855868 $ this ->assertEquals ($ GLOBALS ['conn_error ' ], '#42 Cannot log in to the MySQL server ' );
856869 }
857870
858- #[BackupStaticProperties(true )]
871+ #[RunInSeparateProcess]
872+ #[PreserveGlobalState(false )]
859873 public function testAuthFailsErrno (): void
860874 {
861875 $ this ->object = $ this ->getMockBuilder (AuthenticationCookie::class)
@@ -1022,7 +1036,8 @@ public function testAuthenticate(): void
10221036 * @param mixed[] $rules rules
10231037 * @param string $expected expected result
10241038 */
1025- #[BackupStaticProperties(true )]
1039+ #[RunInSeparateProcess]
1040+ #[PreserveGlobalState(false )]
10261041 #[DataProvider('checkRulesProvider ' )]
10271042 public function testCheckRules (
10281043 string $ user ,
0 commit comments