Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomVariableNotInCmsPageForm.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\Adminhtml\CmsPageNew;
10 use Magento\Variable\Test\Fixture\SystemVariable;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertCustomVariableNotInCmsPageForm extends AbstractConstraint
17 {
25  public function processAssert(
26  CmsPageNew $cmsPageNew,
27  SystemVariable $systemVariable
28  ) {
29  $customVariableName = $systemVariable->getName();
30  $cmsPageNew->open();
31  $cmsPageForm = $cmsPageNew->getPageForm();
32  $variables = $cmsPageForm->getSystemVariables();
33 
34  \PHPUnit\Framework\Assert::assertFalse(
35  in_array($customVariableName, $variables),
36  'Custom System Variable "' . $customVariableName . '" is present in Cms Page Form.'
37  );
38  }
39 
45  public function toString()
46  {
47  return "Custom System Variable is absent in Cms Page Form.";
48  }
49 }