fix(cloud): centralize test-double autoloading via composer files

Move InMemoryRepositories.php from require_once workaround to composer
files-autoload. Enables PSR-4 autoloading of test-double classes and
scales for 5+ future test files. All 8 tests pass with require_once removed.
This commit is contained in:
유창욱 2026-07-11 23:38:01 +09:00
parent 67b9999a31
commit 4bbd28f95f
3 changed files with 1789 additions and 2 deletions

View file

@ -4,5 +4,8 @@
"require": { "php": ">=8.2" }, "require": { "php": ">=8.2" },
"require-dev": { "phpunit/phpunit": "^11" }, "require-dev": { "phpunit/phpunit": "^11" },
"autoload": { "psr-4": { "App\\": "src/" } }, "autoload": { "psr-4": { "App\\": "src/" } },
"autoload-dev": { "psr-4": { "App\\Tests\\": "tests/" } } "autoload-dev": {
"psr-4": { "App\\Tests\\": "tests/" },
"files": ["tests/Support/InMemoryRepositories.php"]
}
} }

1785
cloud/composer.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,6 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace App\Tests; namespace App\Tests;
require_once __DIR__ . '/Support/InMemoryRepositories.php';
use App\Tests\Support\{InMemoryNonceRepository, InMemoryEventRepository, InMemoryRateLimiter}; use App\Tests\Support\{InMemoryNonceRepository, InMemoryEventRepository, InMemoryRateLimiter};
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;