Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSynonymRestrictedAccess.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Search\Test\Page\Adminhtml\SynonymGroupIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 use Magento\Backend\Test\Page\Adminhtml\Dashboard;
12 
16 class AssertSynonymRestrictedAccess extends AbstractConstraint
17 {
21  const ACCESS_DENIED_TEXT = 'Sorry, you need permissions to view this content.';
22 
30  public function processAssert(Dashboard $dashboard, SynonymGroupIndex $synonymGroupIndex)
31  {
32  $synonymGroupIndex->open();
33 
34  \PHPUnit\Framework\Assert::assertContains(
35  self::ACCESS_DENIED_TEXT,
36  $dashboard->getErrorBlock()->getContent(),
37  'Synonym group index page is available.'
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Access to synonym group index page by direct url is restricted.';
49  }
50 }
processAssert(Dashboard $dashboard, SynonymGroupIndex $synonymGroupIndex)