Handle authenticated room instance takeover
CI/CD / test_and_check_app (push) Failing after 2m7s
CI/CD / Publish immutable image (push) Skipped

This commit is contained in:
2026-09-10 16:33:13 +02:00
parent 2ab95cebdf
commit 640a2970c3
18 changed files with 351 additions and 22 deletions
+19
View File
@@ -45,6 +45,25 @@ test('room state broadcasts synchronously expose sanitized state', function () {
]);
});
test('player instance replacement broadcasts the displaced instance', function () {
$event = new RoomStateChanged(
'019b8f80-37c4-71a3-b415-5f2697332c16',
8,
RoomStateChange::PlayerInstanceReplaced,
null,
42,
'019b8f80-37c4-71a3-b415-5f2697332c17',
);
expect($event->broadcastWith())->toBe([
'version' => 8,
'change' => 'player_instance_replaced',
'state' => null,
'affected_player_id' => 42,
'affected_instance_id' => '019b8f80-37c4-71a3-b415-5f2697332c17',
]);
});
test('joining a room broadcasts the new room version', function () {
Event::fake([RoomStateChanged::class]);
$room = createBroadcastRoom();