/** * Verify product price on category view page * * @param CatalogProductBundle $bundle * @param CatalogCategoryView $catalogCategoryView * @return void */ protected function assertPrice(CatalogProductBundle $bundle, CatalogCategoryView $catalogCategoryView) { $priceData = $bundle->getDataFieldConfig('price')['source']->getPreset(); //Price from/to verification $priceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($bundle->getName()); $priceLow = $bundle->getPriceView() == 'Price Range' ? $priceBlock->getPriceFrom() : $priceBlock->getRegularPrice(); \PHPUnit_Framework_Assert::assertEquals($priceData['price_from'], $priceLow, 'Bundle price From on category page is not correct.'); if ($bundle->getPriceView() == 'Price Range') { \PHPUnit_Framework_Assert::assertEquals($priceData['price_to'], $priceBlock->getPriceTo(), 'Bundle price To on category page is not correct.'); } }