File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Test/Unit/Block/System/Config/Form Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
43
43
$ element ->setDisabled (true );
44
44
}
45
45
46
+ if ($ element ->getIsDisableInheritance ()) {
47
+ $ element ->setReadonly (true );
48
+ }
49
+
46
50
$ html = '<td class="label"><label for=" ' .
47
51
$ element ->getHtmlId () . '"><span ' .
48
52
$ this ->_renderScopeLabel ($ element ) . '> ' .
Original file line number Diff line number Diff line change 7
7
8
8
/**
9
9
* Test how class render field html element in Stores Configuration
10
- *
11
- * @package Magento\Config\Test\Unit\Block\System\Config\Form
12
10
*/
13
11
class FieldTest extends \PHPUnit \Framework \TestCase
14
12
{
@@ -72,6 +70,7 @@ protected function setUp()
72
70
'getCanUseDefaultValue ' ,
73
71
'setDisabled ' ,
74
72
'getTooltip ' ,
73
+ 'setReadonly '
75
74
]
76
75
);
77
76
@@ -179,7 +178,8 @@ public function testRenderInheritCheckbox()
179
178
$ this ->_elementMock ->expects ($ this ->any ())->method ('getCanUseWebsiteValue ' )->will ($ this ->returnValue (true ));
180
179
$ this ->_elementMock ->expects ($ this ->any ())->method ('getCanUseDefaultValue ' )->will ($ this ->returnValue (true ));
181
180
$ this ->_elementMock ->expects ($ this ->once ())->method ('setDisabled ' )->with (true );
182
- $ this ->_elementMock ->expects ($ this ->once ())->method ('getIsDisableInheritance ' )->willReturn (true );
181
+ $ this ->_elementMock ->method ('getIsDisableInheritance ' )->willReturn (true );
182
+ $ this ->_elementMock ->method ('setReadonly ' )->with (true );
183
183
184
184
$ expected = '<td class="use-default"> ' ;
185
185
$ expected .= '<input id=" ' .
You can’t perform that action at this time.
0 commit comments