Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertPageByUrlRewriteIsNotFound.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Product\CatalogProductView;
11 use Magento\Mtf\Client\BrowserInterface;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
18 class AssertPageByUrlRewriteIsNotFound extends AbstractConstraint
19 {
23  const NOT_FOUND_MESSAGE = 'Whoops, our bad...';
24 
33  public function processAssert(
34  BrowserInterface $browser,
35  CatalogProductView $catalogProductView,
36  UrlRewrite $productRedirect
37  ) {
38  $browser->open($_ENV['app_frontend_url'] . $productRedirect->getRequestPath());
39  \PHPUnit\Framework\Assert::assertEquals(
40  self::NOT_FOUND_MESSAGE,
41  $catalogProductView->getTitleBlock()->getTitle(),
42  'Wrong page is displayed.'
43  );
44  }
45 
51  public function toString()
52  {
53  return 'Not found page is display.';
54  }
55 }
processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, UrlRewrite $productRedirect)