diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index 478b266693e8..4ce5e25fbc1d 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -44,6 +44,7 @@
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
+ 'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];
diff --git a/.php-cs-fixer.no-header.php b/.php-cs-fixer.no-header.php
index f46f526120e0..e7d9647e317e 100644
--- a/.php-cs-fixer.no-header.php
+++ b/.php-cs-fixer.no-header.php
@@ -32,6 +32,7 @@
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
+ 'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];
diff --git a/.php-cs-fixer.tests.php b/.php-cs-fixer.tests.php
index 404959f26fce..1b4bfd71e30d 100644
--- a/.php-cs-fixer.tests.php
+++ b/.php-cs-fixer.tests.php
@@ -37,6 +37,7 @@
'void_return' => true,
// for updating to coding-standard
'modernize_strpos' => true,
+ 'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];
diff --git a/.php-cs-fixer.user-guide.php b/.php-cs-fixer.user-guide.php
index 5356cef28d93..3be7cd45c708 100644
--- a/.php-cs-fixer.user-guide.php
+++ b/.php-cs-fixer.user-guide.php
@@ -41,6 +41,7 @@
],
// for updating to coding-standard
'modernize_strpos' => true,
+ 'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
'php_unit_attributes' => true,
];
diff --git a/tests/system/Autoloader/AutoloaderTest.php b/tests/system/Autoloader/AutoloaderTest.php
index 647b041d5f78..04dfe04e991f 100644
--- a/tests/system/Autoloader/AutoloaderTest.php
+++ b/tests/system/Autoloader/AutoloaderTest.php
@@ -392,8 +392,8 @@ public function testAutoloaderLoadsNonClassFiles(): void
$loader->unregister();
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testLoadHelpers(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php
index b3908b462777..a550e098e9b0 100644
--- a/tests/system/CodeIgniterTest.php
+++ b/tests/system/CodeIgniterTest.php
@@ -40,9 +40,9 @@
/**
* @internal
*/
-#[RunTestsInSeparateProcesses]
#[BackupGlobals(true)]
#[Group('Others')]
+#[RunTestsInSeparateProcesses]
final class CodeIgniterTest extends CIUnitTestCase
{
private CodeIgniter $codeigniter;
diff --git a/tests/system/Commands/GenerateKeyTest.php b/tests/system/Commands/GenerateKeyTest.php
index 85bd0f9078c2..289a294f5d0c 100644
--- a/tests/system/Commands/GenerateKeyTest.php
+++ b/tests/system/Commands/GenerateKeyTest.php
@@ -88,8 +88,8 @@ public function testGenerateKeyShowsEncodedKey(): void
$this->assertStringContainsString('hex2bin:', $this->getBuffer());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testGenerateKeyCreatesNewKey(): void
{
command('key:generate');
diff --git a/tests/system/CommonFunctionsSendTest.php b/tests/system/CommonFunctionsSendTest.php
index 8af14200ea7f..46871c6284df 100644
--- a/tests/system/CommonFunctionsSendTest.php
+++ b/tests/system/CommonFunctionsSendTest.php
@@ -39,8 +39,8 @@ protected function setUp(): void
* Make sure cookies are set by RedirectResponse this way
* See https://github.com/codeigniter4/CodeIgniter4/issues/1393
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRedirectResponseCookiesSent(): void
{
$loginTime = time();
diff --git a/tests/system/CommonFunctionsTest.php b/tests/system/CommonFunctionsTest.php
index 226f9f79c776..fbbece86ddd1 100644
--- a/tests/system/CommonFunctionsTest.php
+++ b/tests/system/CommonFunctionsTest.php
@@ -272,8 +272,8 @@ public function testEscapeRecursiveArrayRaw(): void
$this->assertSame($data, esc($data, 'raw'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSessionInstance(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -285,8 +285,8 @@ public function testSessionInstance(): void
$this->assertInstanceOf(Session::class, session());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSessionVariable(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -300,8 +300,8 @@ public function testSessionVariable(): void
$this->assertSame('Hi there', session('notbogus'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSessionVariableNotThere(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -426,8 +426,8 @@ public function testModelExistsAbsoluteClassname(): void
$this->assertInstanceOf(JobModel::class, model(JobModel::class));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testOldInput(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -463,8 +463,8 @@ public function testOldInput(): void
$this->assertSame('fritz', old('zibble'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testOldInputSerializeData(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -501,8 +501,8 @@ public function testOldInputSerializeData(): void
/**
* @see https://github.com/codeigniter4/CodeIgniter4/issues/1492
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testOldInputArray(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -620,8 +620,8 @@ public function testRedirectResponseCookies1(): void
$this->assertTrue($answer1->hasCookie('login_time'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testTrace(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -645,8 +645,8 @@ public function testViewNotSaveData(): void
$this->assertStringContainsString('
is_not
', view('\Tests\Support\View\Views\simples'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testForceHttpsNullRequestAndResponse(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -761,8 +761,8 @@ public function testDWithCSP(): void
Kint::$cli_detection = $cliDetection;
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testTraceWithCSP(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
diff --git a/tests/system/CommonHelperTest.php b/tests/system/CommonHelperTest.php
index 819b5c582d4c..90b417d41639 100644
--- a/tests/system/CommonHelperTest.php
+++ b/tests/system/CommonHelperTest.php
@@ -25,8 +25,8 @@
/**
* @internal
*/
-#[Group('Others')]
#[CoversFunction('helper')]
+#[Group('Others')]
final class CommonHelperTest extends CIUnitTestCase
{
private array $dummyHelpers = [
diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php
index 68776b671fda..c8e27dce75ef 100644
--- a/tests/system/Config/BaseConfigTest.php
+++ b/tests/system/Config/BaseConfigTest.php
@@ -101,8 +101,8 @@ public function testUseDefaultValueTypeStringValue(): void
$this->assertSame('123456', $config->password);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testServerValues(): void
{
$_SERVER = [
@@ -195,8 +195,8 @@ public function testSetsDefaultValues(): void
$this->assertSame('bar', $config->second);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSetsDefaultValuesEncryptionUsingHex2Bin(): void
{
$dotenv = new DotEnv($this->fixturesFolder, 'encryption.env');
@@ -208,8 +208,8 @@ public function testSetsDefaultValuesEncryptionUsingHex2Bin(): void
$this->assertSame('OpenSSL', $config->driver);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSetDefaultValuesEncryptionUsingBase64(): void
{
$dotenv = new DotEnv($this->fixturesFolder, 'base64encryption.env');
diff --git a/tests/system/Config/DotEnvTest.php b/tests/system/Config/DotEnvTest.php
index 8ffc4c5dafbc..db54d2663820 100644
--- a/tests/system/Config/DotEnvTest.php
+++ b/tests/system/Config/DotEnvTest.php
@@ -89,8 +89,8 @@ public static function provideLoadsVars(): iterable
];
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testLoadsHex2Bin(): void
{
$dotenv = new DotEnv($this->fixturesFolder, 'encryption.env');
@@ -101,8 +101,8 @@ public function testLoadsHex2Bin(): void
$this->assertSame('OpenSSL', getenv('encryption.driver'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testLoadsBase64(): void
{
$dotenv = new DotEnv($this->fixturesFolder, 'base64encryption.env');
diff --git a/tests/system/Config/ServicesTest.php b/tests/system/Config/ServicesTest.php
index 17b97dd2e259..7825687841c7 100644
--- a/tests/system/Config/ServicesTest.php
+++ b/tests/system/Config/ServicesTest.php
@@ -243,24 +243,24 @@ public function testNewViewcell(): void
$this->assertInstanceOf(Cell::class, $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testNewSession(): void
{
$actual = Services::session();
$this->assertInstanceOf(Session::class, $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testNewSessionWithNullConfig(): void
{
$actual = Services::session(null, false);
$this->assertInstanceOf(Session::class, $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testCallStatic(): void
{
// __callStatic should kick in for this but fail
@@ -271,8 +271,8 @@ public function testCallStatic(): void
$this->assertInstanceOf(Session::class, $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testCallStaticDirectly(): void
{
// $actual = \CodeIgniter\Config\Services::SeSsIoN(null, false); // original
@@ -280,8 +280,8 @@ public function testCallStaticDirectly(): void
$this->assertInstanceOf(Session::class, $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testMockInjection(): void
{
Services::injectMock('response', new MockResponse(new App()));
@@ -300,8 +300,8 @@ public function testMockInjection(): void
$this->assertSame($response, $response3);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testReset(): void
{
Services::injectMock('response', new MockResponse(new App()));
@@ -317,8 +317,8 @@ public function testReset(): void
$this->assertNotSame($response2, $response);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testResetSingle(): void
{
Services::injectMock('response', new MockResponse(new App()));
diff --git a/tests/system/DebugTraceableTraitTest.php b/tests/system/DebugTraceableTraitTest.php
index bd41fda23e33..26161d8de683 100644
--- a/tests/system/DebugTraceableTraitTest.php
+++ b/tests/system/DebugTraceableTraitTest.php
@@ -22,8 +22,8 @@
/**
* @internal
*/
-#[Group('Others')]
#[CoversClass(DebugTraceableTrait::class)]
+#[Group('Others')]
final class DebugTraceableTraitTest extends CIUnitTestCase
{
public function testFactoryInstanceReturnsWhereItIsRaised(): void
diff --git a/tests/system/Events/EventsTest.php b/tests/system/Events/EventsTest.php
index 8ea4fc54f4ce..a2de4fb2f432 100644
--- a/tests/system/Events/EventsTest.php
+++ b/tests/system/Events/EventsTest.php
@@ -49,8 +49,8 @@ protected function tearDown(): void
Events::simulate(false);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testInitialize(): void
{
/**
diff --git a/tests/system/Filters/HoneypotTest.php b/tests/system/Filters/HoneypotTest.php
index ee7b37a8df73..50909abe5a3e 100644
--- a/tests/system/Filters/HoneypotTest.php
+++ b/tests/system/Filters/HoneypotTest.php
@@ -94,8 +94,8 @@ public function testBeforeClean(): void
$this->assertSame($expected, $request);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testAfter(): void
{
$this->config->globals = [
@@ -114,8 +114,8 @@ public function testAfter(): void
$this->assertStringContainsString($this->honey->name, $this->response->getBody());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testAfterNotApplicable(): void
{
$this->config->globals = [
diff --git a/tests/system/Filters/InvalidCharsTest.php b/tests/system/Filters/InvalidCharsTest.php
index ea2ee644b135..a0546ef586bc 100644
--- a/tests/system/Filters/InvalidCharsTest.php
+++ b/tests/system/Filters/InvalidCharsTest.php
@@ -112,8 +112,8 @@ public function testBeforeInvalidControlCharCausesException(): void
$this->invalidChars->before($this->request);
}
- #[DoesNotPerformAssertions]
#[DataProvider('provideCheckControlStringWithLineBreakAndTabReturnsTheString')]
+ #[DoesNotPerformAssertions]
public function testCheckControlStringWithLineBreakAndTabReturnsTheString(string $input): void
{
$_GET['val'] = $input;
diff --git a/tests/system/HTTP/ContentSecurityPolicyTest.php b/tests/system/HTTP/ContentSecurityPolicyTest.php
index 50d93e8c0412..31c915b09b1b 100644
--- a/tests/system/HTTP/ContentSecurityPolicyTest.php
+++ b/tests/system/HTTP/ContentSecurityPolicyTest.php
@@ -72,8 +72,8 @@ protected function work(string $parm = 'Hello')
return $buffer;
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testExistence(): void
{
$this->prepare();
@@ -82,8 +82,8 @@ public function testExistence(): void
$this->assertHeaderEmitted('Content-Security-Policy:');
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testReportOnly(): void
{
$this->prepare();
@@ -93,8 +93,8 @@ public function testReportOnly(): void
$this->assertHeaderEmitted('Content-Security-Policy:');
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testDefaults(): void
{
$this->prepare();
@@ -110,8 +110,8 @@ public function testDefaults(): void
$this->assertStringContainsString("style-src 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testChildSrc(): void
{
$this->prepare();
@@ -125,8 +125,8 @@ public function testChildSrc(): void
$this->assertStringContainsString("child-src 'self' good.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testConnectSrc(): void
{
$this->prepare();
@@ -139,8 +139,8 @@ public function testConnectSrc(): void
$this->assertStringContainsString("connect-src 'self' iffy.com maybe.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testFontSrc(): void
{
$this->prepare();
@@ -155,8 +155,8 @@ public function testFontSrc(): void
$this->assertStringContainsString('font-src fontsrus.com;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testFormAction(): void
{
$this->prepare();
@@ -171,8 +171,8 @@ public function testFormAction(): void
$this->assertStringNotContainsString("form-action 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testFrameAncestor(): void
{
$this->prepare();
@@ -186,8 +186,8 @@ public function testFrameAncestor(): void
$this->assertStringContainsString("frame-ancestors 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testFrameSrc(): void
{
$this->prepare();
@@ -201,8 +201,8 @@ public function testFrameSrc(): void
$this->assertStringContainsString("frame-src 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testImageSrc(): void
{
$this->prepare();
@@ -216,8 +216,8 @@ public function testImageSrc(): void
$this->assertStringContainsString("img-src 'self' cdn.cloudy.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testMediaSrc(): void
{
$this->prepare();
@@ -231,8 +231,8 @@ public function testMediaSrc(): void
$this->assertStringContainsString("media-src 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testManifestSrc(): void
{
$this->prepare();
@@ -246,8 +246,8 @@ public function testManifestSrc(): void
$this->assertStringContainsString('manifest-src cdn.cloudy.com;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testPluginType(): void
{
$this->prepare();
@@ -261,8 +261,8 @@ public function testPluginType(): void
$this->assertStringContainsString("plugin-types 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testPluginArray(): void
{
$this->prepare();
@@ -274,8 +274,8 @@ public function testPluginArray(): void
$this->assertStringContainsString('plugin-types application/x-shockwave-flash application/wacky-hacky;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testObjectSrc(): void
{
$this->prepare();
@@ -289,8 +289,8 @@ public function testObjectSrc(): void
$this->assertStringContainsString("object-src 'self' cdn.cloudy.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testScriptSrc(): void
{
$this->prepare();
@@ -304,8 +304,8 @@ public function testScriptSrc(): void
$this->assertStringContainsString("script-src 'self' cdn.cloudy.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testStyleSrc(): void
{
$this->prepare();
@@ -319,8 +319,8 @@ public function testStyleSrc(): void
$this->assertStringContainsString("style-src 'self' cdn.cloudy.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBaseURIDefault(): void
{
$this->prepare();
@@ -330,8 +330,8 @@ public function testBaseURIDefault(): void
$this->assertStringContainsString("base-uri 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBaseURI(): void
{
$this->prepare();
@@ -342,8 +342,8 @@ public function testBaseURI(): void
$this->assertStringContainsString('base-uri example.com;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBaseURIRich(): void
{
$this->prepare();
@@ -354,8 +354,8 @@ public function testBaseURIRich(): void
$this->assertStringContainsString("base-uri 'self' example.com;", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testDefaultSrc(): void
{
$this->prepare();
@@ -368,8 +368,8 @@ public function testDefaultSrc(): void
$this->assertStringContainsString('default-src iffy.com;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testReportURI(): void
{
$this->prepare();
@@ -381,8 +381,8 @@ public function testReportURI(): void
$this->assertStringContainsString('report-uri http://example.com/csptracker;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSandboxFlags(): void
{
$this->prepare();
@@ -395,8 +395,8 @@ public function testSandboxFlags(): void
$this->assertStringContainsString('sandbox allow-popups allow-top-navigation;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testUpgradeInsecureRequests(): void
{
$this->prepare();
@@ -407,8 +407,8 @@ public function testUpgradeInsecureRequests(): void
$this->assertStringContainsString('upgrade-insecure-requests;', $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBodyEmpty(): void
{
$this->prepare();
@@ -418,8 +418,8 @@ public function testBodyEmpty(): void
$this->assertSame($body, $this->response->getBody());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBodyScriptNonce(): void
{
$this->prepare();
@@ -493,8 +493,8 @@ public function testBodyStyleNonceDisableAutoNonce(): void
$result->assertHeader('Content-Security-Policy');
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testBodyStyleNonce(): void
{
$this->prepare();
@@ -530,8 +530,8 @@ public function testBodyStyleNonceCustomStyleTag(): void
$this->assertStringContainsString('nonce=', $response->getBody());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeaderWrongCaseNotFound(): void
{
$this->prepare();
@@ -541,8 +541,8 @@ public function testHeaderWrongCaseNotFound(): void
$this->assertNull($result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeaderIgnoreCase(): void
{
$this->prepare();
@@ -552,8 +552,8 @@ public function testHeaderIgnoreCase(): void
$this->assertStringContainsString("base-uri 'self';", $result);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testCSPDisabled(): void
{
$this->prepare(false);
@@ -581,8 +581,8 @@ public function testGetStyleNonce(): void
$this->assertMatchesRegularExpression('/\A[0-9a-z]{24}\z/', $nonce);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeaderScriptNonceEmittedOnceGetScriptNonceCalled(): void
{
$this->prepare();
diff --git a/tests/system/HTTP/DownloadResponseTest.php b/tests/system/HTTP/DownloadResponseTest.php
index 20d9d1f39784..2f27bc4651ea 100644
--- a/tests/system/HTTP/DownloadResponseTest.php
+++ b/tests/system/HTTP/DownloadResponseTest.php
@@ -319,8 +319,8 @@ public function testPretendOutput(): void
$this->assertSame(file_get_contents(__FILE__), $actual);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRealOutput(): void
{
$response = new DownloadResponse('unit-test.php', false);
diff --git a/tests/system/HTTP/IncomingRequestTest.php b/tests/system/HTTP/IncomingRequestTest.php
index eb15b2c37c91..f76ea4a0c7cf 100644
--- a/tests/system/HTTP/IncomingRequestTest.php
+++ b/tests/system/HTTP/IncomingRequestTest.php
@@ -148,8 +148,8 @@ public function testCanGetOldInputArrayWithSESSION(): void
/**
* @see https://github.com/codeigniter4/CodeIgniter4/issues/1492
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testCanGetOldInputArrayWithSessionService(): void
{
$locations = [
diff --git a/tests/system/HTTP/RedirectResponseTest.php b/tests/system/HTTP/RedirectResponseTest.php
index b1dc20121903..a800ce0afb2b 100644
--- a/tests/system/HTTP/RedirectResponseTest.php
+++ b/tests/system/HTTP/RedirectResponseTest.php
@@ -131,8 +131,8 @@ public function testRedirectRelativeConvertsToFullURI(): void
$this->assertSame('http://example.com/index.php/foo', $response->getHeaderLine('Location'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testWithInput(): void
{
$_SESSION = [];
@@ -149,8 +149,8 @@ public function testWithInput(): void
$this->assertSame('baz', $_SESSION['_ci_old_input']['post']['bar']);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testWithValidationErrors(): void
{
$_SESSION = [];
@@ -167,8 +167,8 @@ public function testWithValidationErrors(): void
$this->assertArrayHasKey('_ci_validation_errors', $_SESSION);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testWith(): void
{
$_SESSION = [];
@@ -181,8 +181,8 @@ public function testWith(): void
$this->assertArrayHasKey('foo', $_SESSION);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRedirectBack(): void
{
$_SERVER['HTTP_REFERER'] = 'http://somewhere.com';
@@ -196,8 +196,8 @@ public function testRedirectBack(): void
$this->assertSame('http://somewhere.com', $returned->header('location')->getValue());
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRedirectBackMissing(): void
{
$_SESSION = [];
@@ -212,8 +212,8 @@ public function testRedirectBackMissing(): void
/**
* @see https://github.com/codeigniter4/CodeIgniter4/issues/2119
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRedirectRouteBaseUrl(): void
{
$config = new App();
@@ -249,8 +249,8 @@ public function testWithCookies(): void
$this->assertTrue($response->hasCookie('foo', 'bar'));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testWithCookiesWithEmptyCookies(): void
{
$_SESSION = [];
diff --git a/tests/system/HTTP/ResponseSendTest.php b/tests/system/HTTP/ResponseSendTest.php
index cd78155bb656..d910b2de5c29 100644
--- a/tests/system/HTTP/ResponseSendTest.php
+++ b/tests/system/HTTP/ResponseSendTest.php
@@ -45,8 +45,8 @@ final class ResponseSendTest extends CIUnitTestCase
* The tests includes a basic sanity check, to make sure that
* the body we thought would be sent actually was.
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeadersMissingDate(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -81,8 +81,8 @@ public function testHeadersMissingDate(): void
* This test does not test that CSP is handled properly -
* it makes sure that sending gives CSP a chance to do its thing.
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeadersWithCSP(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -120,8 +120,8 @@ public function testHeadersWithCSP(): void
*
* @see https://github.com/codeigniter4/CodeIgniter4/issues/1393
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testRedirectResponseCookies(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php
index a74582b67ebf..35ed834a174c 100644
--- a/tests/system/Helpers/FormHelperTest.php
+++ b/tests/system/Helpers/FormHelperTest.php
@@ -955,8 +955,8 @@ public function testSetCheckboxWithUnchecked(): void
);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSetRadioFromSessionOldInput(): void
{
$_SESSION = [
@@ -973,8 +973,8 @@ public function testSetRadioFromSessionOldInput(): void
unset($_SESSION['_ci_old_input']);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSetRadioFromPost(): void
{
$_POST['bar'] = 'baz';
@@ -984,8 +984,8 @@ public function testSetRadioFromPost(): void
$this->assertSame('', set_radio('bar', 'boop', true));
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testSetRadioFromPostWithValueZero(): void
{
$_POST['bar'] = '0';
diff --git a/tests/system/Helpers/URLHelper/MiscUrlTest.php b/tests/system/Helpers/URLHelper/MiscUrlTest.php
index 87c6a3940208..d38db01c56bf 100644
--- a/tests/system/Helpers/URLHelper/MiscUrlTest.php
+++ b/tests/system/Helpers/URLHelper/MiscUrlTest.php
@@ -58,9 +58,9 @@ protected function tearDown(): void
$_SERVER = [];
}
- #[RunInSeparateProcess]
- #[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+ #[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testPreviousURLUsesSessionFirst(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -93,9 +93,9 @@ private function createRequest(string $uri): void
Factories::injectMock('config', 'App', $this->config);
}
- #[RunInSeparateProcess]
- #[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+ #[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testPreviousURLUsesRefererIfNeeded(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
diff --git a/tests/system/RESTful/ResourceControllerTest.php b/tests/system/RESTful/ResourceControllerTest.php
index dcf59b1c3c19..000abee6e317 100644
--- a/tests/system/RESTful/ResourceControllerTest.php
+++ b/tests/system/RESTful/ResourceControllerTest.php
@@ -42,9 +42,9 @@
*
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class ResourceControllerTest extends CIUnitTestCase
{
private CodeIgniter $codeigniter;
diff --git a/tests/system/RESTful/ResourcePresenterTest.php b/tests/system/RESTful/ResourcePresenterTest.php
index 42772edd09a7..5d98dee4e583 100644
--- a/tests/system/RESTful/ResourcePresenterTest.php
+++ b/tests/system/RESTful/ResourcePresenterTest.php
@@ -36,9 +36,9 @@
*
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class ResourcePresenterTest extends CIUnitTestCase
{
private CodeIgniter $codeigniter;
diff --git a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php
index d49973488b8e..7e8f753d08e0 100644
--- a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php
+++ b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php
@@ -40,9 +40,9 @@
/**
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class SecurityCSRFSessionRandomizeTokenTest extends CIUnitTestCase
{
/**
diff --git a/tests/system/Security/SecurityCSRFSessionTest.php b/tests/system/Security/SecurityCSRFSessionTest.php
index 501967c0c28e..771193bc3171 100644
--- a/tests/system/Security/SecurityCSRFSessionTest.php
+++ b/tests/system/Security/SecurityCSRFSessionTest.php
@@ -38,9 +38,9 @@
/**
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class SecurityCSRFSessionTest extends CIUnitTestCase
{
/**
diff --git a/tests/system/Session/SessionTest.php b/tests/system/Session/SessionTest.php
index 39479d03f21d..9faadb66b219 100644
--- a/tests/system/Session/SessionTest.php
+++ b/tests/system/Session/SessionTest.php
@@ -29,9 +29,9 @@
/**
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class SessionTest extends CIUnitTestCase
{
protected function setUp(): void
diff --git a/tests/system/Test/ControllerTestTraitTest.php b/tests/system/Test/ControllerTestTraitTest.php
index 8230dd9d6248..8708bcce2008 100644
--- a/tests/system/Test/ControllerTestTraitTest.php
+++ b/tests/system/Test/ControllerTestTraitTest.php
@@ -32,9 +32,9 @@
*
* @internal
*/
-#[RunTestsInSeparateProcesses]
-#[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+#[PreserveGlobalState(false)]
+#[RunTestsInSeparateProcesses]
final class ControllerTestTraitTest extends CIUnitTestCase
{
use ControllerTestTrait;
diff --git a/tests/system/Test/TestCaseEmissionsTest.php b/tests/system/Test/TestCaseEmissionsTest.php
index 83f695d8302e..e46a4bf5581d 100644
--- a/tests/system/Test/TestCaseEmissionsTest.php
+++ b/tests/system/Test/TestCaseEmissionsTest.php
@@ -43,8 +43,8 @@ final class TestCaseEmissionsTest extends CIUnitTestCase
* The tests includes a basic sanity check, to make sure that
* the body we thought would be sent actually was.
*/
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeadersEmitted(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
@@ -73,8 +73,8 @@ public function testHeadersEmitted(): void
$this->assertHeaderEmitted('set-cookie: FOO=bar', true);
}
- #[RunInSeparateProcess]
#[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testHeadersNotEmitted(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.
diff --git a/tests/system/View/ParserPluginTest.php b/tests/system/View/ParserPluginTest.php
index 31b6ebba5b48..e37aab0e2309 100644
--- a/tests/system/View/ParserPluginTest.php
+++ b/tests/system/View/ParserPluginTest.php
@@ -46,9 +46,9 @@ public function testCurrentURL(): void
$this->assertSame(current_url(), $this->parser->renderString($template));
}
- #[RunInSeparateProcess]
- #[PreserveGlobalState(false)]
#[Group('SeparateProcess')]
+ #[PreserveGlobalState(false)]
+ #[RunInSeparateProcess]
public function testPreviousURL(): void
{
// Workaround for errors on PHPUnit 10 and PHP 8.3.