From d085c48953d859f0a59ef261a223ca2e47d18e12 Mon Sep 17 00:00:00 2001 From: r-dev Date: Fri, 3 Apr 2026 10:50:29 +0200 Subject: [PATCH] test(custom-fields) : extend factories for machineContextOnly and link params Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/AbstractApiTestCase.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/AbstractApiTestCase.php b/tests/AbstractApiTestCase.php index 517ab94..8ad92b5 100644 --- a/tests/AbstractApiTestCase.php +++ b/tests/AbstractApiTestCase.php @@ -404,11 +404,13 @@ abstract class AbstractApiTestCase extends ApiTestCase ?ModelType $typePiece = null, ?ModelType $typeProduct = null, int $orderIndex = 0, + bool $machineContextOnly = false, ): CustomField { $cf = new CustomField(); $cf->setName($name); $cf->setType($type); $cf->setOrderIndex($orderIndex); + $cf->setMachineContextOnly($machineContextOnly); if (null !== $machine) { $cf->setMachine($machine); } @@ -436,6 +438,8 @@ abstract class AbstractApiTestCase extends ApiTestCase ?Composant $composant = null, ?Piece $piece = null, ?Product $product = null, + ?MachineComponentLink $machineComponentLink = null, + ?MachinePieceLink $machinePieceLink = null, ): CustomFieldValue { $cfv = new CustomFieldValue(); $cfv->setValue($value); @@ -452,6 +456,12 @@ abstract class AbstractApiTestCase extends ApiTestCase if (null !== $product) { $cfv->setProduct($product); } + if (null !== $machineComponentLink) { + $cfv->setMachineComponentLink($machineComponentLink); + } + if (null !== $machinePieceLink) { + $cfv->setMachinePieceLink($machinePieceLink); + } $em = $this->getEntityManager(); $em->persist($cfv);