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


PHP CatalogCategory::getUrlKey方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that filtered product is present on category page by attribute and another products are absent.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param ProcessList $processList
  * @param Browser $browser
  * @param CatalogCategory $category
  * @param InjectableFixture[] $products
  * @param string $searchProductsIndexes
  * @param string $filterLink
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, ProcessList $processList, Browser $browser, CatalogCategory $category, array $products, $searchProductsIndexes, $filterLink)
 {
     $processList->open()->getIndexManagementGrid()->massactionForAll('Reindex Data');
     $browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html');
     $filter = $this->prepareFilter($products[$searchProductsIndexes], $filterLink);
     $catalogCategoryView->getLayeredNavigationBlock()->selectAttribute($filter);
     $this->verify($catalogCategoryView, $products, $searchProductsIndexes);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertProductsVisibleOnCategoryPageShopByAttribute.php

示例2: processAssert

 /**
  * Assert that displayed assigned products on category page equals passed from fixture.
  *
  * @param CatalogCategory $category
  * @param CatalogCategoryView $categoryView
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogCategory $category, CatalogCategoryView $categoryView, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html');
     $products = $category->getDataFieldConfig('category_products')['source']->getProducts();
     foreach ($products as $productFixture) {
         \PHPUnit_Framework_Assert::assertTrue($categoryView->getListProductBlock()->isProductVisible($productFixture), "Products '{$productFixture->getName()}' is not find.");
     }
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertCategoryForAssignedProducts.php

示例3: processAssert

 /**
  * Assert that sitemap.xml file contains correct content according to dataset:
  *  - product url
  *  - category url
  *  - CMS page url
  *
  * @param CatalogProductSimple $product
  * @param CatalogCategory $category
  * @param CmsPage $cmsPage
  * @param Sitemap $sitemap
  * @param SitemapIndex $sitemapIndex
  * @return void
  */
 public function processAssert(CatalogProductSimple $product, CatalogCategory $category, CmsPage $cmsPage, Sitemap $sitemap, SitemapIndex $sitemapIndex)
 {
     $sitemapIndex->open()->getSitemapGrid()->sortGridByField('sitemap_id');
     $filter = ['sitemap_filename' => $sitemap->getSitemapFilename(), 'sitemap_path' => $sitemap->getSitemapPath()];
     $sitemapIndex->getSitemapGrid()->search($filter);
     $content = file_get_contents($sitemapIndex->getSitemapGrid()->getLinkForGoogle());
     $frontendUrl = str_replace('index.php/', '', $_ENV['app_frontend_url']);
     $urls = [$frontendUrl . $product->getUrlKey() . '.html', $frontendUrl . $category->getUrlKey() . '.html', $frontendUrl . $cmsPage->getIdentifier()];
     \PHPUnit_Framework_Assert::assertTrue($this->checkContent($content, $urls), "File '{$sitemap->getSitemapFilename()}' does not contains correct content.");
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:23,代码来源:AssertSitemapContent.php

示例4: processAssert

 /**
  * Assert that displayed category data on category page equals to passed from fixture.
  *
  * @param CatalogCategory $category
  * @param CatalogCategory $initialCategory
  * @param FixtureFactory $fixtureFactory
  * @param CatalogCategoryView $categoryView
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogCategory $category, CatalogCategory $initialCategory, FixtureFactory $fixtureFactory, CatalogCategoryView $categoryView, Browser $browser)
 {
     $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['category_ids' => ['category' => $initialCategory]]]);
     $categoryData = array_merge($initialCategory->getData(), $category->getData());
     $product->persist();
     $url = $_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html';
     $browser->open($url);
     \PHPUnit_Framework_Assert::assertEquals($url, $browser->getUrl(), 'Wrong page URL.');
     if (isset($categoryData['name'])) {
         \PHPUnit_Framework_Assert::assertEquals(strtoupper($categoryData['name']), $categoryView->getTitleBlock()->getTitle(), 'Wrong page title.');
     }
     if (isset($categoryData['description'])) {
         \PHPUnit_Framework_Assert::assertEquals($categoryData['description'], $categoryView->getViewBlock()->getDescription(), 'Wrong category description.');
     }
     if (isset($categoryData['default_sort_by'])) {
         $sortBy = strtolower($categoryData['default_sort_by']);
         $sortType = $categoryView->getTopToolbar()->getSelectSortType();
         \PHPUnit_Framework_Assert::assertEquals($sortBy, $sortType, 'Wrong sorting type.');
     }
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:30,代码来源:AssertCategoryPage.php

示例5: processAssert

 /**
  * Assert that category url rewrite not in grid.
  *
  * @param UrlRewriteIndex $urlRewriteIndex
  * @param CatalogCategory $category
  * @return void
  */
 public function processAssert(UrlRewriteIndex $urlRewriteIndex, CatalogCategory $category)
 {
     $urlRewriteIndex->open();
     $filter = ['request_path' => $category->getUrlKey()];
     \PHPUnit_Framework_Assert::assertFalse($urlRewriteIndex->getUrlRedirectGrid()->isRowVisible($filter), "URL Rewrite with request path '{$filter['request_path']}' is present in grid.");
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:13,代码来源:AssertUrlRewriteCategoryNotInGrid.php

示例6: processAssert

 /**
  * Assert category is not present on frontend.
  *
  * @param Browser $browser
  * @param CatalogCategoryView $categoryView
  * @param CatalogCategory $category
  * @return void
  */
 public function processAssert(Browser $browser, CatalogCategoryView $categoryView, CatalogCategory $category)
 {
     $browser->open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html');
     \PHPUnit_Framework_Assert::assertContains(self::NOT_FOUND_MESSAGE, $categoryView->getViewBlock()->getText(), 'Category is present on frontend.');
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:13,代码来源:AssertCategoryAbsenceOnFrontend.php

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

示例8: processAssert

 /**
  * Assert that filtered product is present on category page by price and another products are absent.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param Browser $browser
  * @param CatalogCategory $category
  * @param InjectableFixture[] $products
  * @param string $searchProductsIndexes
  * @param string $filterLink
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, Browser $browser, CatalogCategory $category, array $products, $searchProductsIndexes, $filterLink)
 {
     $browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html');
     $catalogCategoryView->getLayeredNavigationBlock()->selectPrice($filterLink);
     $this->verify($catalogCategoryView, $products, $searchProductsIndexes);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:17,代码来源:AssertProductsVisibleOnCategoryPageShopByPrice.php


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