Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCatalogSearchNoResultMessage.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 AssertCatalogSearchNoResultMessage extends AbstractConstraint
16 {
20  const NOTICE_MESSAGE = 'Your search returned no results.';
21 
28  public function processAssert(CatalogsearchResult $catalogSearchResult)
29  {
30  \PHPUnit\Framework\Assert::assertTrue(
31  $catalogSearchResult->getSearchResultBlock()->isVisibleMessages(self::NOTICE_MESSAGE),
32  'Wrong message is displayed or no message at all.'
33  );
34  }
35 
41  public function toString()
42  {
43  return 'Notice message is visible.';
44  }
45 }