Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertLocaleCodeVisibility.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 AssertLocaleCodeVisibility extends AbstractConstraint
15 {
22  public function processAssert(SystemConfigEdit $configEdit)
23  {
24  if ($_ENV['mage_mode'] === 'production') {
25  \PHPUnit\Framework\Assert::assertTrue(
26  $configEdit->getForm()->getGroup('general', 'locale')->isFieldDisabled('general', 'locale', 'code'),
27  'Locale field should be disabled in production mode.'
28  );
29  } else {
30  \PHPUnit\Framework\Assert::assertFalse(
31  $configEdit->getForm()->getGroup('general', 'locale')->isFieldDisabled('general', 'locale', 'code'),
32  'Locale field should be not disabled in developer or default mode.'
33  );
34  }
35  }
36 
42  public function toString()
43  {
44  return 'Locale field has correct visibility.';
45  }
46 }