Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCatalogSearchQueryLength.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\CatalogSearch\Test\Page\CatalogsearchResult;
11 
15 class AssertCatalogSearchQueryLength extends AbstractConstraint
16 {
23  public function processAssert(CatalogsearchResult $catalogSearchResult)
24  {
25  \PHPUnit\Framework\Assert::assertEquals(
26  mb_strlen($catalogSearchResult->getSearchResultsTitleBlock()->getSearchQuery()),
27  128,
28  'Search query length is not truncated to 128 symbols.'
29  );
30  }
31 
37  public function toString()
38  {
39  return 'Search query truncated to 128 symbols.';
40  }
41 }