test: project nation receive-assist state

This commit is contained in:
2026-07-26 01:44:22 +00:00
parent de29e2e157
commit e58ffab2a2
2 changed files with 33 additions and 22 deletions
+4 -1
View File
@@ -206,12 +206,15 @@ function comparisonApplyTurnFixtureSetup(mixed $setup): void
'aux' => '{}',
];
$db->insertUpdate('nation', $data, $data);
$nationStor = KVStorage::getStorage($db, $row['id'], 'nation_env');
if (($setup['isolateWorld'] ?? false) === true) {
$nationStor->deleteValue('recv_assist');
}
if (array_key_exists('turnLastByOfficerLevel', $row)) {
$turnLastByOfficerLevel = $row['turnLastByOfficerLevel'];
if (!is_array($turnLastByOfficerLevel)) {
throw new \InvalidArgumentException('setup.nations.turnLastByOfficerLevel must be an object');
}
$nationStor = KVStorage::getStorage($db, $row['id'], 'nation_env');
foreach ($turnLastByOfficerLevel as $officerLevel => $lastTurn) {
$officerLevel = filter_var($officerLevel, FILTER_VALIDATE_INT);
if (