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


PHP InjectableFixture::getData方法代码示例

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


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

示例1: getItemBlockElement

 /**
  * Get element for item block.
  *
  * @param InjectableFixture $address
  * @param int $itemIndex
  * @return ElementInterface
  */
 protected function getItemBlockElement(InjectableFixture $address, $itemIndex)
 {
     $conditions = [];
     foreach ($this->addressFields as $field) {
         $conditions[] = "contains(., '{$address->getData($field)}')";
     }
     $itemBlockSelector = sprintf($this->itemBlock, implode(' and ', $conditions));
     return $this->_rootElement->find($itemBlockSelector, Locator::SELECTOR_XPATH);
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:Items.php

示例2: processAssert

 /**
  * Assert form data equals fixture data.
  *
  * @param InjectableFixture $product
  * @param CatalogProduct $productGrid
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(InjectableFixture $product, CatalogProduct $productGrid, CatalogProductEdit $productPage)
 {
     $this->catalogProductEdit = $productPage;
     $filter = ['sku' => $product->getSku()];
     $productGrid->open();
     $productGrid->getProductGrid()->searchAndOpen($filter);
     $productData = $product->getData();
     $fixtureData = $this->prepareFixtureData($productData, $this->sortFields);
     $formData = $this->prepareFormData($productPage->getProductForm()->getData($product), $this->sortFields);
     $error = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertTrue(empty($error), $error);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:20,代码来源:AssertProductForm.php

示例3: prepareFilter

 /**
  * Prepare filter for assert
  *
  * @param InjectableFixture $product
  * @param array $review
  * @param string $gridStatus [optional]
  * @return array
  */
 public function prepareFilter(InjectableFixture $product, array $review, $gridStatus = '')
 {
     $filter = [];
     foreach ($this->filter as $field) {
         switch ($field) {
             case 'name':
             case 'sku':
                 $value = $product->getData($field);
                 break;
             case 'status_id':
                 $value = $gridStatus !== '' ? $gridStatus : (isset($review[$field]) ? $review[$field] : null);
                 break;
             default:
                 $value = isset($review[$field]) ? $review[$field] : null;
                 break;
         }
         if ($value !== null) {
             $filter += [$field => $value];
         }
     }
     return $filter;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:30,代码来源:AssertProductReviewInGrid.php

示例4: prepareAttributeData

 /**
  * Prepare attribute data.
  *
  * @param InjectableFixture $product
  * @param int $key
  * @return array
  */
 protected function prepareAttributeData(InjectableFixture $product, $key)
 {
     $data = [];
     foreach ($this->attributeProduct as $attributeKey => $attribute) {
         $value = $attribute;
         $attribute = is_numeric($attributeKey) ? $attribute : $attributeKey;
         $attributeValue = $attribute != 'price' ? $product->hasData($attribute) ? $product->getData($attribute) : 'N/A' : ($product->getDataFieldConfig('price')['source']->getPreset() !== null ? $product->getDataFieldConfig('price')['source']->getPreset() : number_format($product->getPrice(), 2));
         $data['attributeValues'][$attribute] = !is_array($attributeValue) ? strtolower($attributeValue) : $attributeValue;
         $attributeName = $value === 'name' || $value === 'price' ? 'Info' : 'MetaData';
         $data['attributeValuesFromPage'][$attribute] = $this->comparePage->getCompareProductsBlock()->{'getProduct' . $attributeName}($key + 1, $value);
     }
     return $data;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:AssertProductComparePage.php

示例5: verifySearchResult

 /**
  * Process assert search result.
  *
  * @param CatalogsearchResult $catalogSearchResult
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param string $param
  * @throws \Exception
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 protected function verifySearchResult(CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, InjectableFixture $product, $param)
 {
     $cmsIndex->open();
     $searchValue = $product->hasData($param) !== false ? $product->getData($param) : null;
     if ($searchValue === null) {
         throw new \Exception("Product '{$product->getName}()' doesn't have '{$param}' parameter.");
     }
     $param = strtoupper($param);
     $this->errorMessage = sprintf($this->formatForErrorMessage, $param);
     $this->successfulMessage = sprintf($this->formatForSuccessfulMessage, $param);
     $cmsIndex->getSearchBlock()->search($searchValue);
     $quantityAndStockStatus = $product->getStockData();
     $stockStatus = isset($quantityAndStockStatus['is_in_stock']) ? $quantityAndStockStatus['is_in_stock'] : null;
     $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product);
     while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
         $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product);
     }
     if ($product->getVisibility() === 'Catalog' || $stockStatus === 'Out of Stock') {
         $isVisible = !$isVisible;
         list($this->errorMessage, $this->successfulMessage) = [$this->successfulMessage, $this->errorMessage];
     }
     \PHPUnit_Framework_Assert::assertTrue($isVisible, $this->errorMessage);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:35,代码来源:AssertProductSearchable.php

示例6: getFixtureFieldsByContainers

 /**
  * Create data array for filling containers.
  *
  * Returns data in format
  * [[abstract_container_name => [field_name => [attribute_name => attribute_value, ..], ..], ..]
  * where container name should be set to 'null' if a field is not present on the form.
  *
  * @param InjectableFixture $fixture
  * @return array
  */
 protected function getFixtureFieldsByContainers(InjectableFixture $fixture)
 {
     $dataByContainer = [];
     $data = $fixture->getData();
     foreach ($data as $field => $value) {
         $attributes = $fixture->getDataFieldConfig($field);
         $attributes['value'] = $value;
         if (array_key_exists('group', $attributes) && $attributes['group'] != 'null') {
             $dataByContainer[$attributes['group']][$field] = $attributes;
         } elseif (!array_key_exists('group', $attributes)) {
             $this->unassignedFields[$field] = $attributes;
         }
     }
     return $dataByContainer;
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:25,代码来源:AbstractFormContainers.php

示例7: getGroupedPrice

 /**
  * Get grouped price with fixture product and product page.
  *
  * @param View $view
  * @param InjectableFixture $product
  * @return array
  */
 protected function getGroupedPrice(View $view, InjectableFixture $product)
 {
     $fields = $product->getData();
     $groupPrice['onPage'] = $view->getPriceBlock()->getSpecialPrice();
     $groupPrice['fixture'] = number_format($fields['group_price'][array_search($this->customerGroup, $fields['group_price'])]['price'], 2);
     return $groupPrice;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:14,代码来源:AssertProductGroupedPriceOnProductPage.php

示例8: getData

 /**
  * Get data of the root form
  *
  * @param InjectableFixture|null $fixture
  * @param Element|null $element
  * @return array
  */
 public function getData(InjectableFixture $fixture = null, Element $element = null)
 {
     if (null === $fixture) {
         $fields = null;
     } else {
         $data = $fixture->hasData() ? $fixture->getData() : [];
         $fields = isset($data['fields']) ? $data['fields'] : $data;
     }
     $mapping = $this->dataMapping($fields);
     return $this->_getData($mapping, $element);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:18,代码来源:Form.php


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