本文整理匯總了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.');
}
示例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;
}
}
示例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;
}
示例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();
}
示例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);
}
示例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];
}
示例7: __prepare
/**
* Prepare data.
*
* @param CatalogCategory $category
* @return array
*/
public function __prepare(CatalogCategory $category)
{
$category->persist();
return ['category' => $category];
}
示例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];
}
示例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];
}
示例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();
}