本文整理匯總了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);
}
示例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.');
}
}
示例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;
}