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);