feat: add battlefield editor GET and POST handlers

This commit is contained in:
Keith Solomon
2026-07-06 22:05:47 -05:00
parent 12b1547fac
commit 7cb670b512
4 changed files with 196 additions and 0 deletions
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace BattleForge\Tests\Integration;
use BattleForge\Http\Handlers\GetBattlefieldEditor;
use BattleForge\Http\Request;
use PHPUnit\Framework\TestCase;
final class GetBattlefieldEditorTest extends TestCase
{
public function testItReturnsTheBattlefieldEditorPageWithAnEmptyGrid(): void
{
$handler = new GetBattlefieldEditor();
$request = new Request([], [], [], [], [], '', 'GET', '/scenarios/demo/edit/battlefield', 'text/html', '');
$response = $handler->handle($request, ['id' => 'demo']);
self::assertSame(200, $response->status);
self::assertStringContainsString('text/html', $response->headers['Content-Type'] ?? '');
self::assertStringContainsString('class="bf-grid"', $response->body);
self::assertStringContainsString('name="_csrf"', $response->body);
}
}