本文整理汇总了PHP中Magento\Mtf\Fixture\FixtureInterface::getVisibility方法的典型用法代码示例。如果您正苦于以下问题:PHP FixtureInterface::getVisibility方法的具体用法?PHP FixtureInterface::getVisibility怎么用?PHP FixtureInterface::getVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\FixtureInterface
的用法示例。
在下文中一共展示了FixtureInterface::getVisibility方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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.');
}
示例2: 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);
}
示例3: 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);
}