feat: add battlefield editor GET and POST handlers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user