test(custom-fields) : extend factories for machineContextOnly and link params
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user