diff --git a/tests/unit/Controllers/JavaScriptMessagesControllerTest.php b/tests/unit/Controllers/JavaScriptMessagesControllerTest.php index 6b0ddfd77d..0c226fcd39 100644 --- a/tests/unit/Controllers/JavaScriptMessagesControllerTest.php +++ b/tests/unit/Controllers/JavaScriptMessagesControllerTest.php @@ -8,7 +8,6 @@ use Fig\Http\Message\StatusCodeInterface; use PhpMyAdmin\Controllers\JavaScriptMessagesController; use PhpMyAdmin\Http\Factory\ResponseFactory; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use function json_decode; @@ -18,7 +17,6 @@ use function substr; #[CoversClass(JavaScriptMessagesController::class)] class JavaScriptMessagesControllerTest extends TestCase { - #[RunInSeparateProcess] public function testIndex(): void { $response = (new JavaScriptMessagesController(ResponseFactory::create()))(); diff --git a/tests/unit/Controllers/SchemaExportControllerTest.php b/tests/unit/Controllers/SchemaExportControllerTest.php index 2a89650982..1f3f7a1e63 100644 --- a/tests/unit/Controllers/SchemaExportControllerTest.php +++ b/tests/unit/Controllers/SchemaExportControllerTest.php @@ -11,12 +11,10 @@ use PhpMyAdmin\Http\ServerRequest; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; #[CoversClass(SchemaExportController::class)] class SchemaExportControllerTest extends AbstractTestCase { - #[RunInSeparateProcess] public function testExport(): void { DatabaseInterface::$instance = $this->createDatabaseInterface(); diff --git a/tests/unit/Controllers/Table/GetFieldControllerTest.php b/tests/unit/Controllers/Table/GetFieldControllerTest.php index d82918dfc2..d624796439 100644 --- a/tests/unit/Controllers/Table/GetFieldControllerTest.php +++ b/tests/unit/Controllers/Table/GetFieldControllerTest.php @@ -13,16 +13,12 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use function bin2hex; #[CoversClass(GetFieldController::class)] class GetFieldControllerTest extends AbstractTestCase { - #[PreserveGlobalState(false)] - #[RunInSeparateProcess] public function testGetFieldController(): void { Current::$database = 'test_db'; diff --git a/tests/unit/Controllers/ThemeSetControllerTest.php b/tests/unit/Controllers/ThemeSetControllerTest.php index 5837f31910..a6d516ebe4 100644 --- a/tests/unit/Controllers/ThemeSetControllerTest.php +++ b/tests/unit/Controllers/ThemeSetControllerTest.php @@ -15,8 +15,6 @@ use PhpMyAdmin\Theme\ThemeManager; use PhpMyAdmin\UserPreferences; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; #[CoversClass(ThemeSetController::class)] class ThemeSetControllerTest extends AbstractTestCase @@ -28,8 +26,6 @@ class ThemeSetControllerTest extends AbstractTestCase DatabaseInterface::$instance = $this->createDatabaseInterface(); } - #[PreserveGlobalState(false)] - #[RunInSeparateProcess] public function testSetTheme(): void { Config::getInstance()->settings['ThemeManager'] = true; @@ -52,8 +48,6 @@ class ThemeSetControllerTest extends AbstractTestCase /** @param string[]|string|null $themeName */ #[DataProvider('providerForTestWithoutTheme')] - #[PreserveGlobalState(false)] - #[RunInSeparateProcess] public function testWithoutTheme(bool $hasThemes, array|string|null $themeName): void { Config::getInstance()->settings['ThemeManager'] = $hasThemes; diff --git a/tests/unit/Http/Factory/ServerRequestFactoryTest.php b/tests/unit/Http/Factory/ServerRequestFactoryTest.php index 0cde1d87fe..9d11865955 100644 --- a/tests/unit/Http/Factory/ServerRequestFactoryTest.php +++ b/tests/unit/Http/Factory/ServerRequestFactoryTest.php @@ -110,8 +110,6 @@ final class ServerRequestFactoryTest extends TestCase * @psalm-param class-string $expectedUri */ #[DataProvider('providerForTestFromGlobals')] - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testFromGlobals(string $provider, string $uriFactoryProvider, string $expectedUri): void { $this->skipIfNotAvailable($provider); @@ -149,8 +147,6 @@ final class ServerRequestFactoryTest extends TestCase * @psalm-param class-string $expectedUri */ #[DataProvider('providerForTestFromGlobals')] - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testFromGlobals2(string $provider, string $uriFactoryProvider, string $expectedUri): void { $this->skipIfNotAvailable($provider); @@ -203,8 +199,6 @@ final class ServerRequestFactoryTest extends TestCase * @psalm-param class-string $expectedUri */ #[DataProvider('providerForTestFromGlobals')] - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testFromGlobals3(string $provider, string $uriFactoryProvider, string $expectedUri): void { $this->skipIfNotAvailable($provider); diff --git a/tests/unit/Plugins/Auth/AuthenticationConfigTest.php b/tests/unit/Plugins/Auth/AuthenticationConfigTest.php index 411ec8e7ce..b4824838ff 100644 --- a/tests/unit/Plugins/Auth/AuthenticationConfigTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationConfigTest.php @@ -13,8 +13,6 @@ use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractTestCase; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Medium; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use Throwable; @@ -57,8 +55,6 @@ class AuthenticationConfigTest extends AbstractTestCase unset($this->object); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuth(): void { (new ReflectionProperty(ResponseRenderer::class, 'instance'))->setValue(null, null); @@ -82,8 +78,6 @@ class AuthenticationConfigTest extends AbstractTestCase ); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFails(): void { Config::getInstance()->settings['Servers'] = [1]; diff --git a/tests/unit/Plugins/Auth/AuthenticationCookieTest.php b/tests/unit/Plugins/Auth/AuthenticationCookieTest.php index 4fbb069309..c86d5675da 100644 --- a/tests/unit/Plugins/Auth/AuthenticationCookieTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationCookieTest.php @@ -16,8 +16,6 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseRendererStub; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Medium; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionException; use ReflectionMethod; use ReflectionProperty; @@ -74,8 +72,6 @@ class AuthenticationCookieTest extends AbstractTestCase unset($this->object); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthErrorAJAX(): void { $GLOBALS['conn_error'] = true; @@ -113,8 +109,6 @@ class AuthenticationCookieTest extends AbstractTestCase ErrorHandler::$instance = $mockErrorHandler; } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthError(): void { $_REQUEST = []; @@ -189,8 +183,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertStringContainsString('', $result); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthCaptcha(): void { $_REQUEST['old_usr'] = ''; @@ -251,8 +243,6 @@ class AuthenticationCookieTest extends AbstractTestCase ); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthCaptchaCheckbox(): void { $_REQUEST['old_usr'] = ''; @@ -315,8 +305,6 @@ class AuthenticationCookieTest extends AbstractTestCase ); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthHeader(): void { $config = Config::getInstance(); @@ -336,8 +324,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame(302, $response->getStatusCode()); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthHeaderPartial(): void { $config = Config::getInstance(); @@ -377,8 +363,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame('Missing Captcha verification, maybe it has been blocked by adblock?', $GLOBALS['conn_error']); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testLogoutDelete(): void { $responseStub = new ResponseRendererStub(); @@ -406,8 +390,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertArrayNotHasKey('pmaAuth-0', $_COOKIE); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testLogout(): void { $responseStub = new ResponseRendererStub(); @@ -657,8 +639,6 @@ class AuthenticationCookieTest extends AbstractTestCase $this->object->rememberCredentials(); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFailsNoPass(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -727,8 +707,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame($GLOBALS['conn_error'], $connError); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFailsDeny(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -759,8 +737,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame($GLOBALS['conn_error'], 'Access denied!'); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFailsActivity(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -798,8 +774,6 @@ class AuthenticationCookieTest extends AbstractTestCase ); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFailsDBI(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -841,8 +815,6 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame($GLOBALS['conn_error'], '#42 Cannot log in to the MySQL server'); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFailsErrno(): void { $this->object = $this->getMockBuilder(AuthenticationCookie::class) @@ -1007,8 +979,6 @@ class AuthenticationCookieTest extends AbstractTestCase * @param mixed[] $rules rules * @param string $expected expected result */ - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] #[DataProvider('checkRulesProvider')] public function testCheckRules( string $user, diff --git a/tests/unit/Plugins/Auth/AuthenticationHttpTest.php b/tests/unit/Plugins/Auth/AuthenticationHttpTest.php index a8cb77ebcf..49614ac3ae 100644 --- a/tests/unit/Plugins/Auth/AuthenticationHttpTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationHttpTest.php @@ -15,8 +15,6 @@ use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseRendererStub; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Medium; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use Throwable; @@ -59,8 +57,6 @@ class AuthenticationHttpTest extends AbstractTestCase unset($this->object); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthLogoutUrl(): void { $config = Config::getInstance(); @@ -77,8 +73,6 @@ class AuthenticationHttpTest extends AbstractTestCase self::assertSame(302, $response->getStatusCode()); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthVerbose(): void { $config = Config::getInstance(); @@ -99,8 +93,6 @@ class AuthenticationHttpTest extends AbstractTestCase self::assertSame(401, $response->getStatusCode()); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthHost(): void { $config = Config::getInstance(); @@ -122,8 +114,6 @@ class AuthenticationHttpTest extends AbstractTestCase self::assertSame(401, $response->getStatusCode()); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthRealm(): void { $config = Config::getInstance(); @@ -276,8 +266,6 @@ class AuthenticationHttpTest extends AbstractTestCase self::assertSame(3, Current::$server); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthFails(): void { $config = Config::getInstance(); diff --git a/tests/unit/Plugins/Auth/AuthenticationSignonTest.php b/tests/unit/Plugins/Auth/AuthenticationSignonTest.php index 24e56e495f..bd3f3fcb53 100644 --- a/tests/unit/Plugins/Auth/AuthenticationSignonTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationSignonTest.php @@ -14,8 +14,6 @@ use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseRendererStub; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use Throwable; @@ -57,8 +55,6 @@ class AuthenticationSignonTest extends AbstractTestCase unset($this->object); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuth(): void { (new ReflectionProperty(ResponseRenderer::class, 'instance'))->setValue(null, null); @@ -81,8 +77,6 @@ class AuthenticationSignonTest extends AbstractTestCase self::assertStringContainsString('You must set SignonURL!', $result); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthLogoutURL(): void { $responseStub = new ResponseRendererStub(); @@ -99,8 +93,6 @@ class AuthenticationSignonTest extends AbstractTestCase self::assertSame(302, $response->getStatusCode()); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthLogout(): void { $responseStub = new ResponseRendererStub(); @@ -151,8 +143,6 @@ class AuthenticationSignonTest extends AbstractTestCase self::assertSame('https://example.com/SignonURL', $_SESSION['LAST_SIGNON_URL']); } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testAuthCheckToken(): void { $_SESSION = [' PMA_token ' => 'eefefef']; diff --git a/tests/unit/SessionTest.php b/tests/unit/SessionTest.php index 27115aa131..16577ef4b7 100644 --- a/tests/unit/SessionTest.php +++ b/tests/unit/SessionTest.php @@ -6,15 +6,11 @@ namespace PhpMyAdmin\Tests; use PhpMyAdmin\Session; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; #[CoversClass(Session::class)] final class SessionTest extends TestCase { - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testSecure(): void { $_SESSION[' PMA_token '] = null; diff --git a/tests/unit/Setup/FormProcessingTest.php b/tests/unit/Setup/FormProcessingTest.php index 1d1703c7c7..2ec5a451e3 100644 --- a/tests/unit/Setup/FormProcessingTest.php +++ b/tests/unit/Setup/FormProcessingTest.php @@ -14,8 +14,6 @@ use PhpMyAdmin\Setup\FormProcessing; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Tests\Stubs\ResponseRenderer as ResponseRendererStub; use PHPUnit\Framework\Attributes\CoversClass; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use Throwable; @@ -39,8 +37,6 @@ class FormProcessingTest extends AbstractTestCase Config::getInstance()->settings['ServerDefault'] = 1; } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testProcessFormSet(): void { DatabaseInterface::$instance = $this->createDatabaseInterface(); diff --git a/tests/unit/StorageEngineTest.php b/tests/unit/StorageEngineTest.php index 094d15cbd1..104a3e11ac 100644 --- a/tests/unit/StorageEngineTest.php +++ b/tests/unit/StorageEngineTest.php @@ -22,8 +22,6 @@ use PhpMyAdmin\StorageEngine; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use function json_encode; @@ -61,8 +59,6 @@ class StorageEngineTest extends AbstractTestCase unset($this->object); } - #[PreserveGlobalState(false)] - #[RunInSeparateProcess] public function testGetStorageEngines(): void { self::assertSame( diff --git a/tests/unit/TemplateTest.php b/tests/unit/TemplateTest.php index 46a1e676aa..cb98974372 100644 --- a/tests/unit/TemplateTest.php +++ b/tests/unit/TemplateTest.php @@ -9,8 +9,6 @@ use PhpMyAdmin\Template; use PhpMyAdmin\Twig\Extensions\Node\TransNode; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; use Twig\Cache\CacheInterface; use Twig\Environment; @@ -163,8 +161,6 @@ class TemplateTest extends AbstractTestCase ]; } - #[RunInSeparateProcess] - #[PreserveGlobalState(false)] public function testLoadingTwigEnvOnlyOnce(): void { $twigEnvCacheProperty = new ReflectionProperty(Template::class, 'twig'); diff --git a/tests/unit/TransformationsTest.php b/tests/unit/TransformationsTest.php index fc8bc022bd..65bf7501a4 100644 --- a/tests/unit/TransformationsTest.php +++ b/tests/unit/TransformationsTest.php @@ -13,8 +13,6 @@ use PhpMyAdmin\Tests\Stubs\DummyResult; use PhpMyAdmin\Transformations; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\PreserveGlobalState; -use PHPUnit\Framework\Attributes\RunInSeparateProcess; use ReflectionProperty; #[CoversClass(Transformations::class)] @@ -76,8 +74,6 @@ class TransformationsTest extends AbstractTestCase ]; } - #[PreserveGlobalState(false)] - #[RunInSeparateProcess] public function testGetTypes(): void { self::assertEquals(