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


PHP FixtureInterface::getName方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that product is present in products grid and can be found by sku, type, status and attribute set.
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productIndex
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productIndex)
 {
     $this->product = $product;
     $productIndex->open();
     $productIndex->getProductGrid()->resetFilter();
     \PHPUnit_Framework_Assert::assertTrue($productIndex->getProductGrid()->isRowVisible($this->prepareFilter()), 'Product \'' . $this->product->getName() . '\' is absent in Products grid.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:AssertProductInGrid.php

示例2: verifyName

 /**
  * Verify displayed product name on product page(front-end) equals passed from fixture
  *
  * @return string|null
  */
 protected function verifyName()
 {
     $fixtureProductName = $this->product->getName();
     $formProductName = $this->productView->getProductName();
     if ($fixtureProductName == $formProductName) {
         return null;
     }
     return "Displayed product name on product page(front-end) not equals passed from fixture. " . "Actual: {$formProductName}, expected: {$fixtureProductName}.";
 }
开发者ID:koliaGI,项目名称:magento2,代码行数:14,代码来源:AssertProductPage.php

示例3: processAssert

 /**
  * Assert that product is not visible in the assigned category
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param FixtureInterface $product
  * @param Category|null $category
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, FixtureInterface $product, Category $category = null)
 {
     $categoryName = $category ? $category->getName() : $product->getCategoryIds()[0];
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     }
     \PHPUnit_Framework_Assert::assertFalse($isProductVisible, 'Product is exist on category page.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:20,代码来源:AssertProductNotVisibleInCategory.php

示例4: prepareData

 /**
  * Prepare data from text to values
  *
  * @param FixtureInterface $fixture
  * @return array
  */
 protected function prepareData(FixtureInterface $fixture)
 {
     $categoryId = $fixture->getDataFieldConfig('root_category_id')['source']->getCategory()->getId();
     $websiteId = $fixture->getDataFieldConfig('website_id')['source']->getWebsite()->getWebsiteId();
     $data = ['group' => ['name' => $fixture->getName(), 'root_category_id' => $categoryId, 'website_id' => $websiteId, 'group_id' => $fixture->hasData('group_id') ? $fixture->getGroupId() : ''], 'store_action' => 'add', 'store_type' => 'group'];
     return $data;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:13,代码来源:Curl.php

示例5: processAssert

 /**
  * Assert that product is visible in the assigned category
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param CmsIndex $cmsIndex
  * @param FixtureInterface $product
  * @param Category|null $category
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, FixtureInterface $product, Category $category = null)
 {
     $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
     $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) {
         $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product->getName());
     }
     if ($product->getVisibility() === 'Search' || $this->getStockStatus($product) === 'Out of Stock') {
         $isProductVisible = !$isProductVisible;
         $this->errorMessage = 'Product found in this category.';
         $this->successfulMessage = 'Asserts that the product could not be found in this category.';
     }
     \PHPUnit_Framework_Assert::assertTrue($isProductVisible, $this->errorMessage);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:27,代码来源:AssertProductVisibleInCategory.php

示例6: processAssert

 /**
  * Assert that product can be searched via Quick Search using searchable product attributes (Search by SKU)
  *
  * @param CatalogsearchResult $catalogSearchResult
  * @param CmsIndex $cmsIndex
  * @param FixtureInterface $product
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, FixtureInterface $product)
 {
     $cmsIndex->open();
     $sku = $product->hasData('sku') !== false ? $product->getSku() : $product->getName();
     $cmsIndex->getSearchBlock()->search($sku);
     $quantityAndStockStatus = $product->getQuantityAndStockStatus();
     $stockStatus = isset($quantityAndStockStatus['is_in_stock']) ? $quantityAndStockStatus['is_in_stock'] : null;
     $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product->getName());
     while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
         $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product->getName());
     }
     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:shabbirvividads,项目名称:magento2,代码行数:27,代码来源:AssertProductSearchableBySku.php

示例7: processAssert

 /**
  * Assert that duplicated product is found by sku and has correct product type, product template,
  * product status disabled and out of stock
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid)
 {
     $config = $product->getDataConfig();
     $filter = ['name' => $product->getName(), 'visibility' => $product->getVisibility(), 'status' => 'Disabled', 'sku' => $product->getSku() . '-1', 'type' => ucfirst($config['create_url_params']['type']) . ' Product', 'price_to' => number_format($product->getPrice(), 2)];
     $productGrid->open()->getProductGrid()->search($filter);
     $filter['price_to'] = '$' . $filter['price_to'];
     \PHPUnit_Framework_Assert::assertTrue($productGrid->getProductGrid()->isRowVisible($filter, false), 'Product duplicate is absent in Products grid.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:AssertProductDuplicatedInGrid.php

示例8: fill

 /**
  * Fill the product form.
  *
  * @param FixtureInterface $product
  * @param SimpleElement|null $element [optional]
  * @param FixtureInterface|null $category [optional]
  * @return $this
  */
 public function fill(FixtureInterface $product, SimpleElement $element = null, FixtureInterface $category = null)
 {
     $sections = $this->getFixtureFieldsByContainers($product);
     ksort($sections);
     if ($category) {
         $sections['product-details']['category_ids']['value'] = $category->getName();
     }
     return $this->fillContainers($sections, $element);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:17,代码来源:ProductForm.php

示例9: fill

 /**
  * Fill the product form
  *
  * @param FixtureInterface $product
  * @param SimpleElement|null $element [optional]
  * @param FixtureInterface|null $category [optional]
  * @return FormTabs
  */
 public function fill(FixtureInterface $product, SimpleElement $element = null, FixtureInterface $category = null)
 {
     $tabs = $this->getFieldsByTabs($product);
     ksort($tabs);
     if ($category) {
         $tabs['product-details']['category_ids']['value'] = $category->getName();
     }
     $this->showAdvancedSettings();
     return $this->fillTabs($tabs, $element);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:18,代码来源:ProductForm.php

示例10: processAssert

 /**
  * Assert the product is not displayed on Compare Products page
  *
  * @param CatalogProductCompare $comparePage
  * @param FixtureInterface $product
  * @param int $countProducts [optional]
  * @return void
  */
 public function processAssert(CatalogProductCompare $comparePage, FixtureInterface $product, $countProducts = 0)
 {
     $comparePage->open();
     $compareBlock = $comparePage->getCompareProductsBlock();
     if ($countProducts > 1) {
         \PHPUnit_Framework_Assert::assertFalse($compareBlock->isProductVisibleInCompareBlock($product->getName()), 'The product displays on Compare Products page.');
     } else {
         \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $compareBlock->getEmptyMessage(), 'The product displays on Compare Products page.');
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:18,代码来源:AssertProductIsNotVisibleInComparePage.php

示例11: selectEntityInGrid

 /**
  * Select entity in grid on layout tab.
  *
  * @param FixtureInterface $product
  * @return void
  */
 protected function selectEntityInGrid(FixtureInterface $product)
 {
     $this->_rootElement->find($this->chooser, Locator::SELECTOR_XPATH)->click();
     $this->getTemplateBlock()->waitLoader();
     /** @var Grid $productGrid */
     $productGrid = $this->blockFactory->create('Magento\\Widget\\Test\\Block\\Adminhtml\\Widget\\Instance\\Edit\\Tab\\WidgetInstanceType\\Product\\Grid', ['element' => $this->_rootElement->find($this->productGrid, Locator::SELECTOR_XPATH)]);
     $productGrid->searchAndSelect(['name' => $product->getName()]);
     $this->getTemplateBlock()->waitLoader();
     $this->_rootElement->find($this->apply, Locator::SELECTOR_XPATH)->click();
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:Products.php

示例12: processAssert

 /**
  * Assert the product is not displayed on Compare Products block on my account page
  *
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountIndex $customerAccountIndex
  * @param int $countProducts [optional]
  * @param FixtureInterface $product [optional]
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, $countProducts = 0, FixtureInterface $product = null)
 {
     $cmsIndex->open();
     $cmsIndex->getLinksBlock()->openLink("My Account");
     $compareBlock = $customerAccountIndex->getCompareProductsBlock();
     if ($countProducts > 1 && $product !== null) {
         \PHPUnit_Framework_Assert::assertFalse($compareBlock->isProductVisibleInCompareBlock($product->getName()), 'The product displays on Compare Products block on my account page.');
     } else {
         \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $compareBlock->getEmptyMessage(), 'The product displays on Compare Products block on my account page.');
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:AssertProductIsNotVisibleInCompareBlock.php

示例13: verifyFullImage

 /**
  * Verify full image on product page(front-end) is displayed correctly
  *
  * @return string|null
  */
 protected function verifyFullImage()
 {
     // click base image to see full image
     $this->productView->clickBaseImage();
     if (!$this->productView->isFullImageVisible()) {
         return 'Full image for product ' . $this->product->getName() . ' should be visible after click on base one';
     }
     if (!$this->isImageLoaded($this->productView->getFullImageSource())) {
         return 'Full image file is corrupted or does not exist for product ' . $this->product->getName();
     }
     $this->productView->closeFullImage();
     return null;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:18,代码来源:AssertImagesAreVisibleOnProductPage.php

示例14: getCartItem

 /**
  * Get cart item block
  *
  * @param FixtureInterface $product
  * @return CartItem
  */
 public function getCartItem(FixtureInterface $product)
 {
     $dataConfig = $product->getDataConfig();
     $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null;
     $cartItem = null;
     if ($this->hasRender($typeId)) {
         $cartItem = $this->callRender($typeId, 'getCartItem', ['product' => $product]);
     } else {
         $cartItemBlock = $this->_rootElement->find(sprintf($this->cartItemByProductName, $product->getName()), Locator::SELECTOR_XPATH);
         $cartItem = $this->blockFactory->create('Magento\\Weee\\Test\\Block\\Cart\\CartItem', ['element' => $cartItemBlock]);
     }
     return $cartItem;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:Cart.php

示例15: assertPrice

 /**
  * Verify product price on category view page.
  *
  * @param FixtureInterface $bundle
  * @param CatalogCategoryView $catalogCategoryView
  * @return void
  */
 protected function assertPrice(FixtureInterface $bundle, CatalogCategoryView $catalogCategoryView)
 {
     /** @var BundleProduct $bundle */
     $priceData = $bundle->getDataFieldConfig('price')['source']->getPreset();
     //Price from/to verification
     $priceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($bundle->getName());
     if ($bundle->hasData('special_price') || $bundle->hasData('group_price')) {
         $priceLow = $priceBlock->getFinalPrice();
     } else {
         $priceLow = $bundle->getPriceView() == 'Price Range' ? $priceBlock->getPriceFrom() : $priceBlock->getRegularPrice();
     }
     \PHPUnit_Framework_Assert::assertEquals($priceData['price_from'], $priceLow, 'Bundle price From on category page is not correct.');
     if ($bundle->getPriceView() == 'Price Range') {
         \PHPUnit_Framework_Assert::assertEquals($priceData['price_to'], $priceBlock->getPriceTo(), 'Bundle price To on category page is not correct.');
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:23,代码来源:AssertBundleInCategory.php


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