From 0362c95d711e3e434a5582072a239109190a436b Mon Sep 17 00:00:00 2001 From: "Valentin F." <95174216+DevSkyLex@users.noreply.github.com> Date: Wed, 7 Oct 2026 12:47:57 +0200 Subject: [PATCH] fix(tests): simplify allocation assertion for static analysis --- .../Service/MaintenanceCostAllocationResolverTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Unit/MaintenanceCost/Application/Service/MaintenanceCostAllocationResolverTest.php b/tests/Unit/MaintenanceCost/Application/Service/MaintenanceCostAllocationResolverTest.php index cc83f25fc..e352d64de 100644 --- a/tests/Unit/MaintenanceCost/Application/Service/MaintenanceCostAllocationResolverTest.php +++ b/tests/Unit/MaintenanceCost/Application/Service/MaintenanceCostAllocationResolverTest.php @@ -256,11 +256,12 @@ public function testCyclicCurrentCorrectionsRetainTheirOwnIncompleteIdentities() $first = new MaintenanceCostItem('material:first', 'material', null, 'first', null, '20.000000', 'EUR', 'First correction', '2026-10-08', correctionOf: 'material:second', equipmentId: 'first-equipment'); $second = new MaintenanceCostItem('material:second', 'material', null, 'second', null, '-5.000000', 'EUR', 'Second correction', '2026-10-09', correctionOf: 'material:first', equipmentId: 'second-equipment'); $self = new MaintenanceCostItem('material:self', 'material', null, 'self', null, '1.000000', 'EUR', 'Self correction', '2026-10-10', correctionOf: 'material:self', equipmentId: 'self-equipment'); - $result = new MaintenanceCostAllocationResolver($work, $equipment)->resolve('org', 'work', [$first, $second, $self], []); + $sources = [$first, $second, $self]; + $result = new MaintenanceCostAllocationResolver($work, $equipment)->resolve('org', 'work', $sources, []); foreach ($result as $index => $item) { self::assertNotNull($item->allocation); self::assertSame('incomplete', $item->allocation['identityState']); - self::assertSame([$first, $second, $self][$index]->equipmentId, $item->equipmentId); + self::assertSame($sources[$index]->equipmentId, $item->equipmentId); self::assertNotNull($item->allocation['equipment']); self::assertSame($item->equipmentId, $item->allocation['equipment']['id']); self::assertNull($item->allocation['site']);