当前位置: 首页>>代码示例>>PHP>>正文


PHP CmsIndex::getTopmenu方法代码示例

本文整理汇总了PHP中mage\cms\test\page\CmsIndex::getTopmenu方法的典型用法代码示例。如果您正苦于以下问题:PHP CmsIndex::getTopmenu方法的具体用法?PHP CmsIndex::getTopmenu怎么用?PHP CmsIndex::getTopmenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mage\cms\test\page\CmsIndex的用法示例。


在下文中一共展示了CmsIndex::getTopmenu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that event block is absent on category/product pages.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param Cache $adminCache
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CatalogProductView $catalogProductView, Cache $adminCache)
 {
     // Flush cache
     $adminCache->open();
     $adminCache->getPageActions()->flushCacheStorage();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $categoryName = $product->getCategoryIds()[0];
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($categoryName);
     \PHPUnit_Framework_Assert::assertFalse($catalogCategoryView->getEventBlock()->isVisible(), "Event block is present on Category page.");
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($categoryName);
     $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName());
     \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getEventBlock()->isVisible(), "Event block is present on Product page.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:25,代码来源:AssertCatalogEventBlockIsAbsent.php

示例2: processAssert

 /**
  * Assert that apache redirect works by opening category page and asserting index.php in its url.
  *
  * @param CatalogCategory $category
  * @param CmsIndex $homePage
  * @param BrowserInterface $browser
  */
 public function processAssert(CatalogCategory $category, CmsIndex $homePage, BrowserInterface $browser)
 {
     $category->persist();
     $homePage->open();
     $homePage->getTopmenu()->selectCategory($category->getName());
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'index.php') === false, 'Apache redirect for category does not work.');
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:14,代码来源:AssertRewritesEnabled.php

示例3: processAssert

 /**
  * Assert that products' MAP has been applied before checkout.
  *
  * @param CatalogCategory $category
  * @param Customer $customer
  * @param Address $address
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param CatalogProductView $catalogProductView
  * @param CheckoutCart $cart
  * @param CheckoutOnepage $checkoutOnePage
  * @param array $products
  * @return void
  */
 public function processAssert(CatalogCategory $category, Customer $customer, Address $address, CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogProductView $catalogProductView, CheckoutCart $cart, CheckoutOnepage $checkoutOnePage, array $products)
 {
     for ($i = 0; $i < count($products); $i++) {
         $cart->getCartBlock()->clearShoppingCart();
         $productName = $products[$i]->getName();
         $cmsIndex->open();
         $cmsIndex->getTopmenu()->selectCategory($category->getName());
         // Check that price is not present on category page.
         $listProductBlock = $catalogCategoryView->getListProductBlock();
         $productPriceBlock = $listProductBlock->getProductPriceBlock($productName);
         $productPriceBlock->clickForPrice();
         \PHPUnit_Framework_Assert::assertFalse($productPriceBlock->getMapBlock()->isPriceVisible(), 'Price is present in MSRP dialog on category page.');
         // Check that price is not present on product page.
         $listProductBlock->openProductViewPage($productName);
         \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), 'Price is present in View block on product page.');
         // Check that price is not present on cart.
         $catalogProductView->getViewBlock()->addToCart($products[$i]);
         \PHPUnit_Framework_Assert::assertTrue($cart->getCartBlock()->getCartItem($products[$i])->isMsrpVisible(), "MSRP link is not visible in cart.");
         // Check that price is present on review block in onepage checkout page.
         $cart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout();
         $checkoutMethodBlock = $checkoutOnePage->getLoginBlock();
         $billingBlock = $checkoutOnePage->getBillingBlock();
         $paymentMethodBlock = $checkoutOnePage->getPaymentMethodsBlock();
         $shippingBlock = $checkoutOnePage->getShippingMethodBlock();
         $checkoutMethodBlock->guestCheckout();
         $checkoutMethodBlock->clickContinue();
         $billingBlock->fillBilling($address, $customer);
         $billingBlock->clickContinue();
         $shippingBlock->selectShippingMethod(['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']);
         $shippingBlock->clickContinue();
         $paymentMethodBlock->selectPaymentMethod(['method' => 'checkmo']);
         $paymentMethodBlock->clickContinue();
         \PHPUnit_Framework_Assert::assertEquals(number_format($products[$i]->getPrice(), 2), $checkoutOnePage->getReviewBlock()->getTotalBlock()->getData('subtotal'), "Subtotal in checkout one page for {$productName} is not equal to expected.");
     }
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:49,代码来源:AssertProductMapAppliedBeforeCheckout.php

示例4: checkEventStatusOnProductPage

 /**
  * Event block has $this->eventStatus on Product Page.
  *
  * @return void
  */
 protected function checkEventStatusOnProductPage()
 {
     $categoryName = $this->product->getDatafieldConfig('category_ids')['source']->getProductCategory()->getName();
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategory($categoryName);
     $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName());
     \PHPUnit_Framework_Assert::assertEquals($this->eventStatus, $this->catalogProductView->getEventBlock()->getEventStatus(), 'Wrong event status is displayed.');
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:13,代码来源:AbstactAssertCatalogEventStatus.php

示例5: processAssert

 /**
  * Assert that Catalog Price Rule is applied for product(s) in Shopping Cart
  * according to Priority(Priority/Stop Further Rules Processing).
  *
  * @param InjectableFixture $product
  * @param CatalogProductView $pageCatalogProductView
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param CheckoutCart $pageCheckoutCart
  * @param array $prices
  * @return void
  */
 public function processAssert(InjectableFixture $product, CatalogProductView $pageCatalogProductView, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CheckoutCart $pageCheckoutCart, array $prices)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
     $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName());
     $pageCatalogProductView->getViewBlock()->addToCart($product);
     $actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price');
     \PHPUnit_Framework_Assert::assertEquals($prices['grand_total'], $actualGrandTotal);
 }
开发者ID:test3metizsoft,项目名称:test,代码行数:21,代码来源:AssertCatalogPriceRuleAppliedInShoppingCart.php

示例6: processAssert

 /**
  * Assert that Catalog Price Rule is applied for product(s) in Catalog
  * according to Priority(Priority/Stop Further Rules Processing).
  *
  * @param InjectableFixture $product
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param array $prices
  * @return void
  */
 public function processAssert(InjectableFixture $product, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, array $prices)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
     $formPrices = $this->getFormPrices($product, $catalogCategoryView);
     $fixturePrices = $this->prepareFixturePrices($prices);
     $diff = $this->verifyData($fixturePrices, $formPrices);
     \PHPUnit_Framework_Assert::assertEmpty($diff, $diff . "\n On: " . date('l jS \\of F Y h:i:s A'));
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:19,代码来源:AssertCatalogPriceRuleAppliedInCatalogPage.php

示例7: checkEventBlockOnPage

 /**
  * Check event block on visibility on specified page.
  *
  * @param string $page
  * @param bool $positive [optional]
  * @return void
  */
 protected function checkEventBlockOnPage($page, $positive = true)
 {
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategory($this->categoryName);
     if ($page == 'product_page') {
         $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->productName);
     }
     $eventBlockVisibility = $this->catalogProductView->getEventBlock()->isVisible();
     $positive == true ? \PHPUnit_Framework_Assert::assertTrue($eventBlockVisibility, "EventBlock is absent on {$page} page.") : \PHPUnit_Framework_Assert::assertFalse($eventBlockVisibility, "EventBlock is present on {$page} page.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:17,代码来源:AssertCatalogEventBlockOnFrontend.php

示例8: processAssert

 /**
  * Assert that created CMS block displayed on frontend category page (in order to assign block to category:
  * go to category page> Display settings> CMS Block).
  *
  * @param CmsIndex $cmsIndex
  * @param CmsBlock $cmsBlock
  * @param CatalogCategoryView $catalogCategoryView
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CmsBlock $cmsBlock, CatalogCategoryView $catalogCategoryView, FixtureFactory $fixtureFactory)
 {
     $category = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => 'default_subcategory', 'data' => ['display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle()]]);
     $category->persist();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($category->getName());
     $categoryViewContent = $catalogCategoryView->getViewBlock()->getText();
     $cmsBlockContent = explode("\n", $categoryViewContent);
     \PHPUnit_Framework_Assert::assertContains($cmsBlock->getContent(), $cmsBlockContent);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertCmsBlockOnCategoryPage.php

示例9: processAssert

 /**
  * Assert that product is absent in the category page.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param CatalogCategory $category
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, InjectableFixture $product, CatalogCategory $category)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($category->getName());
     $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
     while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
     }
     \PHPUnit_Framework_Assert::assertFalse($isProductVisible, 'Product is present on category page.');
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:19,代码来源:AssertProductOutOfStockOnCategory.php

示例10: getCategoryPrice

 /**
  * Get prices on category page.
  *
  * @return array
  */
 protected function getCategoryPrice()
 {
     $prices = [];
     $this->cmsIndex->open();
     $this->cmsIndex->getTopmenu()->selectCategory($this->product->getCategoryIds()[0]);
     $priceBlock = $this->catalogCategoryView->getWeeeListProductBlock()->getProductItem($this->product)->getPriceBlock();
     foreach ($this->expectedPrices['category'] as $key => $type) {
         $prices[$key] = $this->getPrice($priceBlock, $key);
     }
     return $prices;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertFptApplied.php

示例11: processAssert

 /**
  * Assert that out of stock product is visible in the assigned category.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param CatalogCategory|null $category
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, InjectableFixture $product, CatalogCategory $category = null)
 {
     $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($categoryName);
     $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
     while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
     }
     \PHPUnit_Framework_Assert::assertTrue($isProductVisible, "Product is absent on category page.");
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertProductOutOfStockVisibleInCategory.php

示例12: processAssert

 /**
  * Assert that after applying changes, currency symbol changed on Catalog page.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param CatalogProductSimple $product
  * @param CurrencySymbolEntity $currencySymbol
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductSimple $product, CurrencySymbolEntity $currencySymbol)
 {
     $categoryName = $product->getCategoryIds()[0];
     $cmsIndex->open();
     $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol);
     $cmsIndex->getTopmenu()->selectCategory($categoryName);
     $price = $catalogCategoryView->getListProductBlock()->getPrice($product->getId());
     preg_match('`(.*?)\\d`', $price, $matches);
     $symbolOnPage = isset($matches[1]) ? $matches[1] : null;
     \PHPUnit_Framework_Assert::assertEquals($currencySymbol->getCustomCurrencySymbol(), $symbolOnPage, 'Wrong Currency Symbol is displayed on Category page.');
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:20,代码来源:AssertCurrencySymbolOnCatalogPage.php

示例13: processAssert

 /**
  * Assert that Catalog Price Rule is applied & it impacts on product's discount price on Product page.
  *
  * @param InjectableFixture $product
  * @param CatalogProductView $pageCatalogProductView
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param array $prices
  * @return void
  */
 public function processAssert(InjectableFixture $product, CatalogProductView $pageCatalogProductView, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, array $prices)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
     $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName());
     $productPriceBlock = $pageCatalogProductView->getViewBlock()->getPriceBlock();
     $actualPrices['regular'] = $productPriceBlock->getRegularPrice();
     $actualPrices['special'] = $productPriceBlock->getSpecialPrice();
     $actualPrices['discount_amount'] = number_format($actualPrices['regular'] - $actualPrices['special'], 2);
     $diff = $this->verifyData($actualPrices, $prices);
     \PHPUnit_Framework_Assert::assertEmpty($diff, $diff);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:22,代码来源:AssertCatalogPriceRuleAppliedInProductPage.php

示例14: processAssert

 /**
  * Assert that products are absent in category frontend page.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param CatalogCategory $category
  * @param array $unassignedProducts
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogCategory $category, array $unassignedProducts)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($category->getName());
     foreach ($unassignedProducts as $product) {
         $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
         while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
             $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product);
         }
         \PHPUnit_Framework_Assert::assertFalse($isProductVisible, "Product {$product->getName()} is present in category page.");
     }
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:21,代码来源:AssertProductsNotVisibleInCategory.php

示例15: processAssert

 /**
  * Assert that created Order By Sku widget displayed on frontend in Catalog.
  *
  * @param CatalogCategory $category
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param Widget $widget
  * @param Cache $adminCache
  * @return void
  */
 public function processAssert(CatalogCategory $category, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, Widget $widget, Cache $adminCache)
 {
     $category->persist();
     // Flush cache
     $adminCache->open();
     $adminCache->getPageActions()->flushCacheStorage();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($category->getName());
     $errors = $catalogCategoryView->getWidgetView()->checkWidget($widget, "Order by SKU");
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:22,代码来源:AssertWidgetOrderBySkuOnCategoryPage.php


注:本文中的mage\cms\test\page\CmsIndex::getTopmenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。