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 $typePiece = null,
|
||||||
?ModelType $typeProduct = null,
|
?ModelType $typeProduct = null,
|
||||||
int $orderIndex = 0,
|
int $orderIndex = 0,
|
||||||
|
bool $machineContextOnly = false,
|
||||||
): CustomField {
|
): CustomField {
|
||||||
$cf = new CustomField();
|
$cf = new CustomField();
|
||||||
$cf->setName($name);
|
$cf->setName($name);
|
||||||
$cf->setType($type);
|
$cf->setType($type);
|
||||||
$cf->setOrderIndex($orderIndex);
|
$cf->setOrderIndex($orderIndex);
|
||||||
|
$cf->setMachineContextOnly($machineContextOnly);
|
||||||
if (null !== $machine) {
|
if (null !== $machine) {
|
||||||
$cf->setMachine($machine);
|
$cf->setMachine($machine);
|
||||||
}
|
}
|
||||||
@@ -436,6 +438,8 @@ abstract class AbstractApiTestCase extends ApiTestCase
|
|||||||
?Composant $composant = null,
|
?Composant $composant = null,
|
||||||
?Piece $piece = null,
|
?Piece $piece = null,
|
||||||
?Product $product = null,
|
?Product $product = null,
|
||||||
|
?MachineComponentLink $machineComponentLink = null,
|
||||||
|
?MachinePieceLink $machinePieceLink = null,
|
||||||
): CustomFieldValue {
|
): CustomFieldValue {
|
||||||
$cfv = new CustomFieldValue();
|
$cfv = new CustomFieldValue();
|
||||||
$cfv->setValue($value);
|
$cfv->setValue($value);
|
||||||
@@ -452,6 +456,12 @@ abstract class AbstractApiTestCase extends ApiTestCase
|
|||||||
if (null !== $product) {
|
if (null !== $product) {
|
||||||
$cfv->setProduct($product);
|
$cfv->setProduct($product);
|
||||||
}
|
}
|
||||||
|
if (null !== $machineComponentLink) {
|
||||||
|
$cfv->setMachineComponentLink($machineComponentLink);
|
||||||
|
}
|
||||||
|
if (null !== $machinePieceLink) {
|
||||||
|
$cfv->setMachinePieceLink($machinePieceLink);
|
||||||
|
}
|
||||||
|
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$em->persist($cfv);
|
$em->persist($cfv);
|
||||||
|
|||||||
Reference in New Issue
Block a user