1010use PhpMyAdmin \ResponseRenderer ;
1111use PhpMyAdmin \Tests \AbstractTestCase ;
1212use PhpMyAdmin \Tests \Stubs \ResponseRenderer as ResponseRendererStub ;
13+ use PHPUnit \Framework \Attributes \BackupStaticProperties ;
1314use PHPUnit \Framework \Attributes \CoversClass ;
1415use ReflectionProperty ;
1516use Throwable ;
@@ -55,8 +56,10 @@ protected function tearDown(): void
5556 unset($ this ->object );
5657 }
5758
59+ #[BackupStaticProperties(true )]
5860 public function testAuth (): void
5961 {
62+ (new ReflectionProperty (ResponseRenderer::class, 'instance ' ))->setValue (null , null );
6063 $ GLOBALS ['cfg ' ]['Server ' ]['SignonURL ' ] = '' ;
6164 $ _REQUEST = [];
6265 ResponseRenderer::getInstance ()->setAjax (false );
@@ -76,6 +79,7 @@ public function testAuth(): void
7679 $ this ->assertStringContainsString ('You must set SignonURL! ' , $ result );
7780 }
7881
82+ #[BackupStaticProperties(true )]
7983 public function testAuthLogoutURL (): void
8084 {
8185 $ responseStub = new ResponseRendererStub ();
@@ -91,6 +95,7 @@ public function testAuthLogoutURL(): void
9195 $ this ->assertSame (302 , $ response ->getStatusCode ());
9296 }
9397
98+ #[BackupStaticProperties(true )]
9499 public function testAuthLogout (): void
95100 {
96101 $ responseStub = new ResponseRendererStub ();
@@ -139,6 +144,7 @@ public function testAuthCheckSession(): void
139144 $ this ->assertEquals ('https://example.com/SignonURL ' , $ _SESSION ['LAST_SIGNON_URL ' ]);
140145 }
141146
147+ #[BackupStaticProperties(true )]
142148 public function testAuthCheckToken (): void
143149 {
144150 $ _SESSION = [' PMA_token ' => 'eefefef ' ];
0 commit comments