Skip to content

Commit 466930a

Browse files
committed
cs-fix
1 parent 489d201 commit 466930a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/system/HTTP/ContentSecurityPolicyTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ public function testClearNoncePlaceholdersWithDefaultTags(): void
943943
$config = new CSPConfig();
944944
$csp = new ContentSecurityPolicy($config);
945945

946-
$body = 'Test {csp-script-nonce} and {csp-style-nonce} here';
946+
$body = 'Test {csp-script-nonce} and {csp-style-nonce} here';
947947
$cleaned = $csp->clearNoncePlaceholders($body);
948948

949949
$this->assertSame('Test and here', $cleaned);
@@ -958,7 +958,7 @@ public function testClearNoncePlaceholdersWithCustomTags(): void
958958
$config->styleNonceTag = '{custom-style-nonce}';
959959
$csp = new ContentSecurityPolicy($config);
960960

961-
$body = 'Test {custom-script-nonce} and {custom-style-nonce} here';
961+
$body = 'Test {custom-script-nonce} and {custom-style-nonce} here';
962962
$cleaned = $csp->clearNoncePlaceholders($body);
963963

964964
$this->assertSame('Test and here', $cleaned);
@@ -971,7 +971,7 @@ public function testClearNoncePlaceholdersWithEmptyBody(): void
971971
$config = new CSPConfig();
972972
$csp = new ContentSecurityPolicy($config);
973973

974-
$body = '';
974+
$body = '';
975975
$cleaned = $csp->clearNoncePlaceholders($body);
976976

977977
$this->assertSame('', $cleaned);
@@ -982,7 +982,7 @@ public function testClearNoncePlaceholdersWithNoPlaceholders(): void
982982
$config = new CSPConfig();
983983
$csp = new ContentSecurityPolicy($config);
984984

985-
$body = 'Test body with no placeholders';
985+
$body = 'Test body with no placeholders';
986986
$cleaned = $csp->clearNoncePlaceholders($body);
987987

988988
$this->assertSame($body, $cleaned);
@@ -993,7 +993,7 @@ public function testClearNoncePlaceholdersWithMultiplePlaceholders(): void
993993
$config = new CSPConfig();
994994
$csp = new ContentSecurityPolicy($config);
995995

996-
$body = '<script {csp-script-nonce}>a</script><script {csp-script-nonce}>b</script><style {csp-style-nonce}>c</style>';
996+
$body = '<script {csp-script-nonce}>a</script><script {csp-script-nonce}>b</script><style {csp-style-nonce}>c</style>';
997997
$cleaned = $csp->clearNoncePlaceholders($body);
998998

999999
$this->assertStringNotContainsString('{csp-script-nonce}', $cleaned);

tests/system/HTTP/ResponseTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use DateTimeZone;
2525
use PHPUnit\Framework\Attributes\DataProvider;
2626
use PHPUnit\Framework\Attributes\Group;
27+
use ReflectionClass;
2728

2829
/**
2930
* @internal
@@ -615,7 +616,7 @@ public function testSendRemovesCustomNoncePlaceholdersWhenCSPDisabled(): void
615616
$response->pretend(true);
616617

617618
// Inject the custom CSP config
618-
$reflection = new \ReflectionClass($response);
619+
$reflection = new ReflectionClass($response);
619620
$cspProperty = $reflection->getProperty('CSP');
620621
$cspProperty->setValue($response, new ContentSecurityPolicy($cspConfig));
621622

0 commit comments

Comments
 (0)