/** * Assert that displayed price view for bundle product on product page equals passed from fixture. * * @param CatalogProductView $catalogProductView * @param BrowserInterface $browser * @param BundleProduct $product * @return void */ public function processAssert(CatalogProductView $catalogProductView, BrowserInterface $browser, BundleProduct $product) { //Open product view page $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); //Process assertions $this->assertPrice($product, $catalogProductView); }
/** * Assert that displayed price for bundle items on shopping cart page equals to passed from fixture. * Price for bundle items has two options: * 1. Fixed (price of bundle product) * 2. Dynamic (price of bundle item) * * @param CatalogProductView $catalogProductView * @param BundleProduct $product * @param CheckoutCart $checkoutCartView * @param BrowserInterface $browser * @param BundleProduct $originalProduct [optional] * @return void */ public function processAssert(CatalogProductView $catalogProductView, BundleProduct $product, CheckoutCart $checkoutCartView, BrowserInterface $browser, BundleProduct $originalProduct = null) { $checkoutCartView->open()->getCartBlock()->clearShoppingCart(); //Open product view page $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); //Process assertions $this->assertPrice($product, $catalogProductView, $checkoutCartView, $originalProduct); }
/** * Assert that displayed product bundle items data on product page equals passed from fixture. * * @param CatalogProductView $catalogProductView * @param BundleProduct $product * @param BrowserInterface $browser * @return void */ public function processAssert(CatalogProductView $catalogProductView, BundleProduct $product, BrowserInterface $browser) { $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $productOptions = $this->prepareBundleOptions($product); $productOptions = $this->sortDataByPath($productOptions, '::title'); foreach ($productOptions as $key => $productOption) { $productOptions[$key] = $this->sortDataByPath($productOption, 'options::title'); } $formOptions = $catalogProductView->getViewBlock()->getOptions($product)['bundle_options']; $formOptions = $this->sortDataByPath($formOptions, '::title'); foreach ($formOptions as $key => $formOption) { $formOptions[$key] = $this->sortDataByPath($formOption, 'options::title'); } $error = $this->verifyData($productOptions, $formOptions); \PHPUnit_Framework_Assert::assertEmpty($error, $error); }