objectManager = Bootstrap::getObjectManager(); $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); } /** * Check minimal and maximal prices are calculated correctly for Bundle product selections with Tier Prices. * * @return void * @magentoDataFixture Magento/Bundle/_files/bundle_product_with_tier_price_selections.php */ public function testGetPriceForBundleSelectionsWithTierPrices(): void { $priceModel = $this->getPriceModel('bundle_with_tier_price_selections'); $this->assertEquals(15.0, $priceModel->getMinimalPrice()->getValue()); $this->assertEquals(45.0, $priceModel->getMaximalPrice()->getValue()); } /** * Create and retrieve Price Model for provided Product SKU. * * @param string $productSku * @return FinalPrice */ private function getPriceModel(string $productSku): FinalPrice { $bundleProduct = $this->productRepository->get($productSku); return $this->objectManager->create( FinalPrice::class, [ 'saleableItem' => $bundleProduct, 'quantity' => 0., ] ); } }