當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CatalogCategory::persist方法代碼示例

本文整理匯總了PHP中Mage\Catalog\Test\Fixture\CatalogCategory::persist方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogCategory::persist方法的具體用法?PHP CatalogCategory::persist怎麽用?PHP CatalogCategory::persist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mage\Catalog\Test\Fixture\CatalogCategory的用法示例。


在下文中一共展示了CatalogCategory::persist方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

示例2: __construct

 /**
  * @constructor
  * @param FixtureFactory $fixtureFactory
  * @param array $params
  * @param array|int $data
  */
 public function __construct(FixtureFactory $fixtureFactory, array $params, $data = [])
 {
     $this->params = $params;
     if (isset($data['dataSet'])) {
         $this->parentCategory = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => $data['dataSet']]);
         if (!$this->parentCategory->hasData('id')) {
             $this->parentCategory->persist();
         }
         $this->data = $this->parentCategory->getId();
     } elseif (isset($data['data']) && isset($data['parent_category'])) {
         $this->data = $data['data'];
         $this->parentCategory = $data['parent_category'];
     } else {
         $this->data = $data;
     }
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:22,代碼來源:ParentId.php

示例3: __prepare

 /**
  * Prepare data.
  *
  * @param CatalogCategory $category
  * @param CatalogProduct $productGrid
  * @param CatalogProductEdit $editProductPage
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function __prepare(CatalogCategory $category, CatalogProduct $productGrid, CatalogProductEdit $editProductPage, FixtureFactory $fixtureFactory)
 {
     $this->category = $category;
     $this->category->persist();
     $this->productGrid = $productGrid;
     $this->editProductPage = $editProductPage;
     $this->fixtureFactory = $fixtureFactory;
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:17,代碼來源:DuplicateProductEntityTest.php

示例4: test

 /**
  * Delete category.
  *
  * @param CatalogCategory $category
  * @return void
  */
 public function test(CatalogCategory $category)
 {
     // Preconditions:
     $category->persist();
     // Steps:
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     $this->catalogCategoryIndex->getFormPageActions()->deleteAndAcceptAlert();
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:15,代碼來源:DeleteCategoryEntityTest.php

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

示例6: __prepare

 /**
  * Prepare configuration and create customer.
  *
  * @param Customer $customer
  * @param CatalogCategory $category
  * @return array
  */
 public function __prepare(Customer $customer, CatalogCategory $category)
 {
     $customer->persist();
     $category->persist();
     return ['customer' => $customer, 'category' => $category];
 }
開發者ID:QiuLihua83,項目名稱:magento-ee,代碼行數:13,代碼來源:CreateMultipleWishlistEntityTest.php

示例7: __prepare

 /**
  * Prepare data.
  *
  * @param CatalogCategory $category
  * @return array
  */
 public function __prepare(CatalogCategory $category)
 {
     $category->persist();
     return ['category' => $category];
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:11,代碼來源:CreateVirtualProductEntityTest.php

示例8: __inject

 /**
  * Injection data.
  *
  * @param FixtureFactory $fixtureFactory
  * @return array
  */
 public function __inject(FixtureFactory $fixtureFactory)
 {
     $this->category = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => 'anchor_category']);
     $this->category->persist();
     return ['category' => $this->category];
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:12,代碼來源:FilterProductListTest.php

示例9: test

 /**
  * Update category.
  *
  * @param CatalogCategory $category
  * @param CatalogCategory $initialCategory
  * @param string $unassignedProductsKeys [optional]
  * @return array
  */
 public function test(CatalogCategory $category, CatalogCategory $initialCategory, $unassignedProductsKeys = '')
 {
     $this->unassignedProductsKeys = $unassignedProductsKeys;
     $initialCategory->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($initialCategory);
     $category = $this->updateCategoryFixture($initialCategory, $category);
     $this->catalogCategoryIndex->getCategoryForm()->fill($category);
     $this->catalogCategoryIndex->getFormPageActions()->save();
     return ['category' => $category, 'unassignedProducts' => $this->unassignedProducts];
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:19,代碼來源:UpdateCategoryEntityTest.php

示例10: test

 /**
  * Generate sitemap test.
  *
  * @param Sitemap $sitemap
  * @param CatalogProductSimple $product
  * @param CatalogCategory $category
  * @param CmsPage $cmsPage
  * @return void
  */
 public function test(Sitemap $sitemap, CatalogProductSimple $product, CatalogCategory $category, CmsPage $cmsPage)
 {
     // Preconditions
     $product->persist();
     $category->persist();
     $cmsPage->persist();
     // Steps
     $this->sitemapIndex->open();
     $this->sitemapIndex->getGridPageActions()->addNew();
     $this->sitemapNew->getSitemapForm()->fill($sitemap);
     $this->sitemapNew->getFormPageActions()->saveAndGenerate();
 }
開發者ID:QiuLihua83,項目名稱:magento-ee,代碼行數:21,代碼來源:GenerateSitemapEntityTest.php


注:本文中的Mage\Catalog\Test\Fixture\CatalogCategory::persist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。