Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomVariableRestrictedAccess.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Cms\Test\Page\Adminhtml\CmsPageNew;
11 use Magento\Variable\Test\Fixture\SystemVariable;
12 
16 class AssertCustomVariableRestrictedAccess extends AbstractConstraint
17 {
25  public function processAssert(
26  CmsPageNew $cmsPageNew,
27  SystemVariable $systemVariable
28  ) {
29  $systemVariable->persist();
30  $cmsPageNew->open();
31 
32  \PHPUnit\Framework\Assert::assertFalse(
33  $cmsPageNew->getPageForm()->isVariablesBlockVisible(),
34  'Access to system variables block is supposed to be restricted.'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Access to system variables block is restricted and block is not visible.';
46  }
47 }