test(piece) : add quantity tests for MachinePieceLink

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-12 12:06:23 +01:00
parent a940f53f8a
commit 1f90f809ac
2 changed files with 39 additions and 1 deletions

View File

@@ -284,11 +284,12 @@ abstract class AbstractApiTestCase extends ApiTestCase
return $link;
}
protected function createMachinePieceLink(Machine $machine, Piece $piece, ?MachineComponentLink $parentLink = null): MachinePieceLink
protected function createMachinePieceLink(Machine $machine, Piece $piece, ?MachineComponentLink $parentLink = null, int $quantity = 1): MachinePieceLink
{
$link = new MachinePieceLink();
$link->setMachine($machine);
$link->setPiece($piece);
$link->setQuantity($quantity);
if (null !== $parentLink) {
$link->setParentLink($parentLink);
}