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


PHP CmsIndex::getSearchBlock方法代码示例

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


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

示例1: processAssert

 /**
  * Check that after input some text(e.g. product name) into search field, drop-down window is appeared.
  * Window contains requested entity and number of quantity.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $catalogSearch
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogSearchQuery $catalogSearch)
 {
     $cmsIndex->open();
     $searchBlock = $cmsIndex->getSearchBlock();
     $queryText = $catalogSearch->getQueryText();
     $searchBlock->fillSearch($queryText);
     $isVisible = $catalogSearch->hasData('num_results') ? $searchBlock->isSuggestSearchVisible($queryText, $catalogSearch->getNumResults()) : $searchBlock->isSuggestSearchVisible($queryText);
     \PHPUnit_Framework_Assert::assertTrue($isVisible, 'Block "Suggest Search" when searching was not found.');
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:17,代码来源:AssertSuggestSearchingResult.php

示例2: processAssert

 /**
  * Assert that product can be found via Quick Search using searchable product attributes label.
  *
  * @param CatalogsearchResult $catalogSearchResult
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @return void
  */
 public function processAssert(CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, InjectableFixture $product, CatalogProductAttribute $attribute)
 {
     $cmsIndex->open();
     $filter = $this->prepareFilter($product, $attribute);
     $cmsIndex->getSearchBlock()->search($filter);
     $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product);
     while (!$isProductVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
         $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product);
     }
     \PHPUnit_Framework_Assert::assertTrue($isProductVisible, 'Product was not found by option label.');
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:20,代码来源:AssertProductAttributeSearchableByLabel.php

示例3: test

 /**
  * Run suggest searching result test.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $catalogSearch
  * @return void
  */
 public function test(CmsIndex $cmsIndex, CatalogSearchQuery $catalogSearch)
 {
     // Steps:
     $cmsIndex->open();
     $cmsIndex->getSearchBlock()->search($catalogSearch->getQueryText());
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:13,代码来源:SuggestSearchingResultEntityTest.php

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

示例5: processAssert

 /**
  * Assert that product cannot be found via Quick Search using searchable product attributes.
  *
  * @param CatalogsearchResult $catalogSearchResult
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CatalogsearchResult $catalogSearchResult, CmsIndex $cmsIndex, InjectableFixture $product)
 {
     $cmsIndex->open();
     $cmsIndex->getSearchBlock()->search($product->getSku());
     \PHPUnit_Framework_Assert::assertFalse($catalogSearchResult->getListProductBlock()->isProductVisible($product), 'Product was found by SKU.');
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:14,代码来源:AssertProductNotSearchableBySku.php


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