Fixed tests

This commit is contained in:
Jan Böhmer 2023-11-22 17:14:24 +01:00
parent c86694ab8f
commit 50069c7611
2 changed files with 15 additions and 1 deletions

View file

@ -31,6 +31,9 @@ use App\Entity\Parts\PartLot;
use App\Entity\PriceInformations\Orderdetail;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
/**
* @implements EntityMergerInterface<Part>
*/
#[Autoconfigure(public: true)]
class PartMerger implements EntityMergerInterface
{
@ -74,7 +77,7 @@ class PartMerger implements EntityMergerInterface
$this->mergeTags($target, $other, 'tags');
//Merge manufacturing status
$this->useCallback(function (?ManufacturingStatus $t, ?ManufacturingStatus $o): ?ManufacturingStatus {
$this->useCallback(function (?ManufacturingStatus $t, ?ManufacturingStatus $o): ManufacturingStatus {
//Use the other value, if the target value is not set
if ($t === ManufacturingStatus::NOT_SET || $t === null) {
return $o ?? ManufacturingStatus::NOT_SET;
@ -91,6 +94,9 @@ class PartMerger implements EntityMergerInterface
return $t;
}, $target, $other, 'providerReference');
//Merge the collections
$this->mergeCollectionFields($target, $other, $context);
return $target;
}