initialization
This commit is contained in:
commit
9ff09693ed
92 files changed
+46209
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Utils\SecurityConfig;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class ProductionSecurityConfigTest extends TestCase
|
||||
{
|
||||
public function testDevelopmentDefaultsKeepLocalhostCorsAndDebugLogging(): void
|
||||
{
|
||||
$this->assertSame('http://localhost:8080', SecurityConfig::resolveCorsOrigin('development'));
|
||||
$this->assertSame(100, SecurityConfig::resolveRateLimit('development', 100));
|
||||
$this->assertSame(100, SecurityConfig::resolveLogLevel('debug'));
|
||||
}
|
||||
|
||||
public function testProductionDefaultsRejectWildcardOriginsAndUseRestrictedLogging(): void
|
||||
{
|
||||
$this->assertSame('', SecurityConfig::resolveCorsOrigin('production'));
|
||||
$this->assertSame(120, SecurityConfig::resolveRateLimit('production', 120));
|
||||
$this->assertSame(300, SecurityConfig::resolveLogLevel('warning'));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user