Add repo hygiene rules and ignore secrets
This commit is contained in:
30
server/tests/Unit/QueueSlotsTest.php
Normal file
30
server/tests/Unit/QueueSlotsTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Unit;
|
||||
|
||||
use App\Config\ConfigLoader;
|
||||
use App\Config\ConfigValidator;
|
||||
use App\Module\Blueprints\Service\BlueprintService;
|
||||
use App\Module\BuildQueue\Service\BuildQueueService;
|
||||
use App\Shared\Clock\FixedTimeProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class QueueSlotsTest extends TestCase
|
||||
{
|
||||
public function testQueueSlotsGrowWithBuildCenter(): void
|
||||
{
|
||||
$pdo = new \PDO('sqlite::memory:');
|
||||
$loader = new ConfigLoader(new ConfigValidator(), dirname(__DIR__, 3) . '/config');
|
||||
$blueprints = new BlueprintService($loader);
|
||||
$service = new BuildQueueService($pdo, $blueprints, new FixedTimeProvider(new \DateTimeImmutable('2026-02-03 00:00:00')));
|
||||
|
||||
$buildings = [
|
||||
'build_center' => ['count' => 2, 'level' => 0],
|
||||
];
|
||||
|
||||
$slots = $service->calculateQueueSlots($buildings, 0);
|
||||
self::assertSame(2, $slots);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user