Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCategoryAbsenceOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11 use Magento\Mtf\Client\BrowserInterface;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
18 class AssertCategoryAbsenceOnFrontend extends AbstractConstraint
19 {
20  /* tags */
21  const SEVERITY = 'low';
22  /* end tags */
23 
27  const NOT_FOUND_MESSAGE = 'Whoops, our bad...';
28 
37  public function processAssert(
38  BrowserInterface $browser,
39  CatalogCategoryView $categoryView,
40  Category $category
41  ) {
42  $browser->open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html');
43  \PHPUnit\Framework\Assert::assertEquals(
44  self::NOT_FOUND_MESSAGE,
45  $categoryView->getTitleBlock()->getTitle(),
46  'Wrong page is displayed.'
47  );
48  }
49 
55  public function toString()
56  {
57  return 'Not found page is display.';
58  }
59 }
processAssert(BrowserInterface $browser, CatalogCategoryView $categoryView, Category $category)