Skip to content

Commit d397810

Browse files
adding constructor parameter updated
1 parent 8f4dcc1 commit d397810

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/Config/Block/System/Config/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,28 +131,28 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
131131
* @param \Magento\Framework\Data\FormFactory $formFactory
132132
* @param \Magento\Config\Model\Config\Factory $configFactory
133133
* @param \Magento\Config\Model\Config\Structure $configStructure
134-
* @param \Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker $settingChecker
135134
* @param \Magento\Config\Block\System\Config\Form\Fieldset\Factory $fieldsetFactory
136135
* @param \Magento\Config\Block\System\Config\Form\Field\Factory $fieldFactory
137136
* @param array $data
137+
* @param SettingChecker|null $settingChecker
138138
*/
139139
public function __construct(
140140
\Magento\Backend\Block\Template\Context $context,
141141
\Magento\Framework\Registry $registry,
142142
\Magento\Framework\Data\FormFactory $formFactory,
143143
\Magento\Config\Model\Config\Factory $configFactory,
144144
\Magento\Config\Model\Config\Structure $configStructure,
145-
\Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker $settingChecker,
146145
\Magento\Config\Block\System\Config\Form\Fieldset\Factory $fieldsetFactory,
147146
\Magento\Config\Block\System\Config\Form\Field\Factory $fieldFactory,
148-
array $data = []
147+
array $data = [],
148+
SettingChecker $settingChecker = null
149149
) {
150150
parent::__construct($context, $registry, $formFactory, $data);
151151
$this->_configFactory = $configFactory;
152152
$this->_configStructure = $configStructure;
153153
$this->_fieldsetFactory = $fieldsetFactory;
154154
$this->_fieldFactory = $fieldFactory;
155-
$this->settingChecker = $settingChecker;
155+
$this->settingChecker = $settingChecker ?: ObjectManager::getInstance()->get(SettingChecker::class);
156156

157157
$this->_scopeLabels = [
158158
self::SCOPE_DEFAULT => __('[GLOBAL]'),

app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ protected function setUp()
102102
\Magento\Config\Block\System\Config\Form\Fieldset\Factory::class
103103
);
104104
$this->_fieldFactoryMock = $this->createMock(\Magento\Config\Block\System\Config\Form\Field\Factory::class);
105+
$settingCheckerMock = $this->getMockBuilder(SettingChecker::class)
106+
->disableOriginalConstructor()
107+
->getMock();
105108
$this->_coreConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
106109

107110
$this->_backendConfigMock = $this->createMock(\Magento\Config\Model\Config::class);
@@ -153,6 +156,7 @@ protected function setUp()
153156
'fieldsetFactory' => $this->_fieldsetFactoryMock,
154157
'fieldFactory' => $this->_fieldFactoryMock,
155158
'context' => $context,
159+
'settingChecker' => $settingCheckerMock,
156160
];
157161

158162
$objectArguments = $helper->getConstructArguments(\Magento\Config\Block\System\Config\Form::class, $data);

0 commit comments

Comments
 (0)