The PHP app runs on Cafe24 shared web hosting -- calling it 'cloud' was misleading. Renames the directory, the edge client module, and every doc/script/identifier that used the term. - cloud/ -> server/ (incl. server/deploy/build_cafe24_package.sh paths) - edge/cloudclient.py -> edge/serverclient.py, CloudClient -> ServerClient - cloud/docs/cloud-deploy.md -> server/docs/server-deploy.md - CLOUD_* env/config keys -> SERVER_* - tests renamed to match Tests: PHP 109 pass (4 skipped), pytest 167 pass. dist/ regenerated.
24 lines
767 B
PHP
24 lines
767 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace App\Tests;
|
|
use App\Config;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class ConfigTest extends TestCase
|
|
{
|
|
public function testTypedGettersWithDefaults(): void
|
|
{
|
|
$c = Config::fromArray(['db_dsn' => 'sqlite::memory:']);
|
|
$this->assertSame('sqlite::memory:', $c->dbDsn());
|
|
$this->assertSame(300, $c->timestampWindow());
|
|
$this->assertSame(60, $c->rateLimitPerMin());
|
|
$this->assertSame(86400, $c->nonceTtl());
|
|
}
|
|
|
|
public function testOverrides(): void
|
|
{
|
|
$c = Config::fromArray(['db_dsn' => 'x', 'timestamp_window' => 120, 'rate_limit_per_min' => 30]);
|
|
$this->assertSame(120, $c->timestampWindow());
|
|
$this->assertSame(30, $c->rateLimitPerMin());
|
|
}
|
|
}
|