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


PHP CatalogCategory::getName方法代码示例

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


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

示例1: isNotDisplayingOnFrontendAssert

 /**
  * Verify product displaying on frontend.
  *
  * @param InjectableFixture $product
  * @return array
  */
 protected function isNotDisplayingOnFrontendAssert(InjectableFixture $product)
 {
     $errors = [];
     //Check that product is not available by url
     $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     if ($this->catalogProductView->getViewBlock()->isVisible()) {
         $errors[] = '- product view block is visible in product page.';
     }
     //Check that product can't be found
     $this->cmsIndex->open()->getSearchBlock()->search($product->getSku());
     if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product)) {
         $errors[] = '- successful product search.';
     }
     //Check that product is not available in category page
     $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName();
     $this->cmsIndex->open()->getTopmenu()->selectCategory($categoryName);
     $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product);
     $bottomToolBar = $this->catalogCategoryView->getBottomToolbar();
     while (!$isProductVisible && $bottomToolBar->nextPage()) {
         $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product);
     }
     if ($isProductVisible) {
         $errors[] = "- product with name '{$product->getName()}' is found in this category.";
     }
     return $errors;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:32,代码来源:AssertProductIsNotDisplayingOnFrontend.php

示例2: processAssert

 /**
  * Assert that Wishlist can't be find by another Customer (or guest) via "Wishlist Search".
  *
  * @param CustomerAccountLogout $customerAccountLogout
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param SearchResult $searchResult
  * @param CatalogCategory $category
  * @param Customer $customer
  * @param Wishlist $wishlist
  * @return void
  */
 public function processAssert(CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, SearchResult $searchResult, CatalogCategory $category, Customer $customer, Wishlist $wishlist)
 {
     $customerAccountLogout->open();
     $cmsIndex->open()->getTopmenu()->selectCategory($category->getName());
     $catalogCategoryView->getWishlistSearchBlock()->searchByCustomer($customer);
     \PHPUnit_Framework_Assert::assertFalse($searchResult->getWishlistSearchResultBlock()->isWishlistVisibleInGrid($wishlist), "Multiple wishlist is visible on wishlist search result page.");
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:19,代码来源:AssertMultipleWishlistIsPrivate.php

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: processAssert

 /**
  * Assert that product products' MAP has been applied on gesture.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param CatalogCategory $category
  * @param array $products
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogCategory $category, array $products)
 {
     foreach ($products as $product) {
         $productName = $product->getName();
         $cmsIndex->open();
         $cmsIndex->getTopmenu()->selectCategory($category->getName());
         $listProductBlock = $catalogCategoryView->getListProductBlock();
         // Check that price is present in MAP popup.
         $productPriceBlock = $listProductBlock->getProductPriceBlock($productName);
         $productPriceBlock->clickForPrice();
         $msrpPopupBlock = $productPriceBlock->getMapBlock();
         $map = $msrpPopupBlock->isVisible() ? $msrpPopupBlock->getMap() : null;
         \PHPUnit_Framework_Assert::assertEquals(number_format($product->getPrice(), 2), $map, "MAP of {$productName} product is not visible or not equal to product price.");
     }
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:24,代码来源:AssertProductMapAppliedOnGesture.php

示例10: processAssert

 /**
  * Assert that product is visible in the assigned category.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param CatalogCategory|null $category
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 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);
     }
     if ($product->getVisibility() === 'Search' || $this->getStockStatus($product) === 'Out of Stock') {
         $isProductVisible = !$isProductVisible;
         $this->errorMessage = 'Product found in this category.';
         $this->successfulMessage = 'Asserts that the product could not be found in this category.';
     }
     \PHPUnit_Framework_Assert::assertTrue($isProductVisible, $this->errorMessage);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:27,代码来源:AssertProductVisibleInCategory.php

示例11: processAssert

 /**
  * Checking the product in the page of its price.
  *
  * @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)
 {
     // Open category view page and check visible product
     $categoryName = $category->getName();
     if ($product->hasData('category_ids')) {
         $categoryIds = $product->getCategoryIds();
         $categoryName = is_array($categoryIds) ? reset($categoryIds) : $categoryName;
     }
     $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.');
     //Process price asserts
     $this->assertPrice($product, $catalogCategoryView);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:27,代码来源:AssertProductInCategory.php

示例12: processAssert

 /**
  * Assert that product products' MAP has been applied in cart.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param CatalogCategory $category
  * @param CatalogProductView $catalogProductView
  * @param CheckoutCart $cart
  * @param array $products
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogCategory $category, CatalogProductView $catalogProductView, CheckoutCart $cart, array $products)
 {
     foreach ($products as $product) {
         $cart->getCartBlock()->clearShoppingCart();
         $productName = $product->getName();
         $cmsIndex->open();
         $cmsIndex->getTopmenu()->selectCategory($category->getName());
         $listProductBlock = $catalogCategoryView->getListProductBlock();
         // Check that price is not present on category page.
         $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 present in cart.
         $catalogProductView->getViewBlock()->addToCart($product);
         \PHPUnit_Framework_Assert::assertEquals(number_format($product->getPrice(), 2), $cart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'), "MAP of {$productName} product in cart is not equal to product price.");
     }
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:31,代码来源:AssertProductMapAppliedInCart.php

示例13: prepareFullCategoryPath

 /**
  * Prepare category path.
  *
  * @param CatalogCategory $category
  * @return array
  */
 protected function prepareFullCategoryPath(CatalogCategory $category)
 {
     $path = [];
     $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory();
     if ($parentCategory != null) {
         $path = $this->prepareFullCategoryPath($parentCategory);
     }
     return array_filter(array_merge($path, [$category->getPath(), $category->getName()]));
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:15,代码来源:Categories.php

示例14: processAssert

 /**
  * Assert that old category URL lead to appropriate Category in frontend.
  *
  * @param CatalogCategory $category
  * @param Browser $browser
  * @param CatalogCategory $initialCategory
  * @param CatalogCategoryView $catalogCategoryView
  * @return void
  */
 public function processAssert(CatalogCategory $category, Browser $browser, CatalogCategory $initialCategory, CatalogCategoryView $catalogCategoryView)
 {
     $browser->open(str_replace('index', 'cron', $_ENV['app_frontend_url']));
     $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertEquals($catalogCategoryView->getTitleBlock()->getTitle(), strtoupper($category->getName()), 'Old category URL does not lead to appropriate Category in frontend.');
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:15,代码来源:AssertCategoryRedirect.php


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