Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertDeveloperSectionVisibility.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Mtf\Constraint\AbstractConstraint;
9 use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
10 
14 class AssertDeveloperSectionVisibility extends AbstractConstraint
15 {
22  public function processAssert(SystemConfigEdit $configEdit)
23  {
24  if ($_ENV['mage_mode'] === 'production') {
25  \PHPUnit\Framework\Assert::assertFalse(
26  in_array('Developer', $configEdit->getTabs()->getSubTabsNames('Advanced')),
27  'Developer section should be hidden in production mode.'
28  );
29  } else {
30  \PHPUnit\Framework\Assert::assertTrue(
31  in_array('Developer', $configEdit->getTabs()->getSubTabsNames('Advanced')),
32  'Developer section should be not hidden in developer or default mode.'
33  );
34  }
35  }
36 
42  public function toString()
43  {
44  return 'Developer section has correct visibility.';
45  }
46 }