Files
zombie-game/tests/Feature/GameStressTestTest.php
T
2026-09-08 22:33:51 +02:00

51 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Feature;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
final class GameStressTestTest extends TestCase
{
#[Test]
public function unknown_scenario_rejects_with_failure(): void
{
$this->artisan('game:stress', ['--scenario' => 'aliens'])
->expectsOutputToContain('Unknown scenario')
->assertExitCode(1);
}
#[Test]
public function step_below_one_rejects_with_failure(): void
{
$this->artisan('game:stress', ['--step' => '0'])
->expectsOutputToContain('Invalid sweep range')
->assertExitCode(1);
}
#[Test]
public function inverted_range_rejects_with_failure(): void
{
$this->artisan('game:stress', ['--entities-from' => '200', '--entities-to' => '100'])
->expectsOutputToContain('Invalid sweep range')
->assertExitCode(1);
}
#[Test]
public function breakpoint_run_reports_capacity_limits(): void
{
$this->artisan('game:stress', [
'--entities-from' => '50',
'--entities-to' => '50',
'--step' => '50',
'--ticks' => '5',
'--breakpoint-only' => true,
])
->expectsOutputToContain('Derived capacity limits')
->expectsOutputToContain('Reverb cap')
->assertExitCode(0);
}
}