function it_marks_product_as_updated_when_a_product_media_is_updated(EntityManager $em, UnitOfWork $uow, ProductInterface $product, ProductValueInterface $value, ProductMediaInterface $media) { $media->getValue()->willReturn($value); $value->getEntity()->willReturn($product); $this->guessUpdates($em, $media, UpdateGuesserInterface::ACTION_UPDATE_ENTITY)->shouldReturn([$product]); }
function it_provides_export_path($filesystem, ProductMediaInterface $media, ProductValueInterface $value, AttributeInterface $attribute, ProductInterface $product) { $filesystem->has('akeneo.jpg')->willReturn(true); $media->getValue()->willReturn($value); $media->getFilename()->willReturn('akeneo.jpg'); $value->getAttribute()->willReturn($attribute); $value->getEntity()->willReturn($product); $product->getIdentifier()->willReturn('my-sku'); $attribute->getCode()->willReturn('thumbnail'); $attribute->isLocalizable()->willReturn(true); $value->getLocale()->willReturn('en_US'); $attribute->isScopable()->willReturn(true); $value->getScope()->willReturn('mobile'); $media->getOriginalFilename()->willReturn('akeneo.jpg'); $this->getExportPath($media)->shouldReturn('files/my-sku/thumbnail/en_US/mobile/akeneo.jpg'); $this->getExportPath($media, 'custom-sku')->shouldReturn('files/custom-sku/thumbnail/en_US/mobile/akeneo.jpg'); }