diff --git a/src/Model/FeedItem/GoogleFeedItem.php b/src/Model/FeedItem/GoogleFeedItem.php index a3d847ddc..8d26892b1 100644 --- a/src/Model/FeedItem/GoogleFeedItem.php +++ b/src/Model/FeedItem/GoogleFeedItem.php @@ -6,7 +6,7 @@ use Shopsys\FrameworkBundle\Model\Feed\FeedItemInterface; use Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency; -use Shopsys\FrameworkBundle\Model\Pricing\Price; +use Shopsys\FrameworkBundle\Model\Pricing\PriceInterface; use Shopsys\FrameworkBundle\Model\Pricing\SpecialPrice\SpecialPrice; class GoogleFeedItem implements FeedItemInterface @@ -20,7 +20,7 @@ class GoogleFeedItem implements FeedItemInterface * @param int $id * @param string $name * @param bool $sellingDenied - * @param \Shopsys\FrameworkBundle\Model\Pricing\Price $price + * @param \Shopsys\FrameworkBundle\Model\Pricing\PriceInterface $price * @param \Shopsys\FrameworkBundle\Model\Pricing\SpecialPrice\SpecialPrice|null $specialPrice * @param \Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency $currency * @param string $url @@ -34,7 +34,7 @@ public function __construct( protected readonly int $id, protected readonly string $name, protected readonly bool $sellingDenied, - protected readonly Price $price, + protected readonly PriceInterface $price, protected readonly ?SpecialPrice $specialPrice, protected readonly Currency $currency, protected readonly string $url, @@ -111,9 +111,9 @@ public function getAvailability(): string } /** - * @return \Shopsys\FrameworkBundle\Model\Pricing\Price + * @return \Shopsys\FrameworkBundle\Model\Pricing\PriceInterface */ - public function getPrice(): Price + public function getPrice(): PriceInterface { return $this->price; } diff --git a/src/Model/FeedItem/GoogleFeedItemFactory.php b/src/Model/FeedItem/GoogleFeedItemFactory.php index 6e46764be..514545927 100644 --- a/src/Model/FeedItem/GoogleFeedItemFactory.php +++ b/src/Model/FeedItem/GoogleFeedItemFactory.php @@ -7,7 +7,7 @@ use Shopsys\FrameworkBundle\Component\Domain\Config\DomainConfig; use Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency; use Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade; -use Shopsys\FrameworkBundle\Model\Pricing\Price; +use Shopsys\FrameworkBundle\Model\Pricing\PriceInterface; use Shopsys\FrameworkBundle\Model\Pricing\SpecialPrice\SpecialPrice; use Shopsys\FrameworkBundle\Model\Pricing\SpecialPrice\SpecialPriceFacade; use Shopsys\FrameworkBundle\Model\Product\Availability\ProductAvailabilityFacade; @@ -70,14 +70,14 @@ protected function getBrandName(Product $product): ?string /** * @param \Shopsys\FrameworkBundle\Model\Product\Product $product * @param \Shopsys\FrameworkBundle\Component\Domain\Config\DomainConfig $domainConfig - * @return \Shopsys\FrameworkBundle\Model\Pricing\Price + * @return \Shopsys\FrameworkBundle\Model\Pricing\PriceInterface */ - protected function getPrice(Product $product, DomainConfig $domainConfig): Price + protected function getPrice(Product $product, DomainConfig $domainConfig): PriceInterface { return $this->productPriceCalculationForCustomerUser->calculateBasicPriceForCustomerUserAndDomainId( $product, $domainConfig->getId(), - ); + )->getPrice(); } /** diff --git a/tests/Unit/GoogleFeedItemTest.php b/tests/Unit/GoogleFeedItemTest.php index b935875e3..65d4fd007 100644 --- a/tests/Unit/GoogleFeedItemTest.php +++ b/tests/Unit/GoogleFeedItemTest.php @@ -11,6 +11,7 @@ use Shopsys\FrameworkBundle\Component\Money\Money; use Shopsys\FrameworkBundle\Model\Pricing\Currency\Currency; use Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade; +use Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroup; use Shopsys\FrameworkBundle\Model\Pricing\Price; use Shopsys\FrameworkBundle\Model\Pricing\SpecialPrice\SpecialPriceFacade; use Shopsys\FrameworkBundle\Model\Product\Availability\ProductAvailabilityFacade; @@ -132,7 +133,7 @@ private function createDomainConfigMock(int $id, string $url, string $locale, Cu */ private function mockProductPrice(Product $product, DomainConfig $domain, Price $price): void { - $productPrice = new ProductPrice($price, false); + $productPrice = new ProductPrice($price, $this->createMock(PricingGroup::class), false); $this->productPriceCalculationForCustomerUserMock->method('calculateBasicPriceForCustomerUserAndDomainId') ->with($product, $domain->getId(), null)->willReturn($productPrice); }