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


PHP CatalogCategory::getData方法代碼示例

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


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

示例1: processAssert

 /**
  * Assert that displayed category data on edit page(backend) equals passed from fixture.
  *
  * @param CatalogCategory $category
  * @param CatalogCategoryIndex $catalogCategoryIndex
  * @return void
  */
 public function processAssert(CatalogCategory $category, CatalogCategoryIndex $catalogCategoryIndex)
 {
     $data = $category->getData();
     $catalogCategoryIndex->open();
     $catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     $dataForm = $catalogCategoryIndex->getCategoryForm()->getDataCategory($category);
     $error = $this->verifyData($data, $dataForm);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:16,代碼來源:AssertCategoryForm.php

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

示例3: prepareCategoryData

 /**
  * Prepare category date.
  *
  * @param CatalogCategory $initialCategory
  * @param CatalogCategory $category
  * @return array
  */
 protected function prepareCategoryData(CatalogCategory $initialCategory, CatalogCategory $category)
 {
     $categoryData = array_merge($initialCategory->getData(), $category->getData());
     if (isset($categoryData['category_products'])) {
         $categoryData['category_products'] = $this->prepareCategoryProducts($initialCategory, $category);
     }
     $categoryData['parent_id'] = $this->prepareParentCategory($initialCategory, $category);
     return $categoryData;
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:16,代碼來源:UpdateCategoryEntityTest.php


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