function it_marks_product_as_updated_when_a_product_price_is_updated(EntityManager $em, UnitOfWork $uow, ProductInterface $product, ProductValueInterface $value, ProductPriceInterface $price) { $price->getValue()->willReturn($value); $value->getEntity()->willReturn($product); $em->getUnitOfWork()->willReturn($uow); $uow->getEntityChangeSet($price)->willReturn(['data' => ['10', '11']]); $this->guessUpdates($em, $price, UpdateGuesserInterface::ACTION_UPDATE_ENTITY)->shouldReturn([$product]); }
function it_returns_data_if_it_is_not_a_numeric(ProductPriceInterface $price, ProductValueInterface $productValue, AttributeInterface $attribute) { $price->getValue()->willReturn($productValue); $productValue->getAttribute()->willReturn($attribute); $attribute->isDecimalsAllowed()->willReturn(false); $price->getCurrency()->willReturn('EUR'); $price->getData()->willReturn('a_price_data'); $this->normalize($price, 'standard', ['is_decimals_allowed' => false])->shouldReturn(['amount' => 'a_price_data', 'currency' => 'EUR']); }