From 8f762120ecac5e96ab972b382553c958c0b5dcc6 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Tue, 3 Nov 2026 09:59:20 +0100 Subject: [PATCH] test: the map relations test places its barbarian on a free field, so a random spawn can't take it Co-Authored-By: Claude Opus 5.5 --- tests/Feature/MapRelationsTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Feature/MapRelationsTest.php b/tests/Feature/MapRelationsTest.php index 36b0b06..3cf1b52 100644 --- a/tests/Feature/MapRelationsTest.php +++ b/tests/Feature/MapRelationsTest.php @@ -26,7 +26,9 @@ it('colours villages by what their owner is to the viewer', function () { $ally = startVillage(); $foe = startVillage(); $stranger = startVillage(); - $barbarian = app(VillageFactory::class)->create($me->world, null, 'Barbarian village', $me->x + 2, $me->y + 2, ['headquarters' => 1]); + // A free field near me: the other players settle at random and may take any given one. + $spot = collect(range(2, 10))->first(fn (int $d) => ! Village::where('world_id', $me->world_id)->where('x', $me->x + $d)->where('y', $me->y + 2)->exists()); + $barbarian = app(VillageFactory::class)->create($me->world, null, 'Barbarian village', $me->x + $spot, $me->y + 2, ['headquarters' => 1]); foreach ([[$me, 'AAA'], [$ally, 'BBB'], [$foe, 'CCC']] as [$v, $tag]) { app(Tribes::class)->found(owner($v), $v->world_id, "Tribe $tag", $tag); }