@@ -71,15 +71,16 @@ public function setUp()
71
71
* @param string $scopeCode
72
72
* @param string|null $confValue
73
73
* @param array $variables
74
+ * @param array $configMap
74
75
* @param bool $expectedResult
75
76
* @dataProvider isReadonlyDataProvider
76
77
*/
77
- public function testIsReadonly ($ path , $ scope , $ scopeCode , $ confValue , array $ variables , $ expectedResult )
78
+ public function testIsReadonly ($ path , $ scope , $ scopeCode , $ confValue , array $ variables , array $ configMap , $ expectedResult )
78
79
{
79
- $ this ->placeholderMock ->expects ($ this ->once ())
80
+ $ this ->placeholderMock ->expects ($ this ->any ())
80
81
->method ('isApplicable ' )
81
82
->willReturn (true );
82
- $ this ->placeholderMock ->expects ($ this ->once ())
83
+ $ this ->placeholderMock ->expects ($ this ->any ())
83
84
->method ('generate ' )
84
85
->with ($ path , $ scope , $ scopeCode )
85
86
->willReturn ('SOME_PLACEHOLDER ' );
@@ -95,13 +96,13 @@ public function testIsReadonly($path, $scope, $scopeCode, $confValue, array $var
95
96
96
97
$ this ->configMock ->expects ($ this ->any ())
97
98
->method ('get ' )
98
- ->willReturnMap ([
99
+ ->willReturnMap (array_merge ( [
99
100
[
100
101
'system/ ' . $ scope . "/ " . ($ scopeCode ? $ scopeCode . '/ ' : '' ) . $ path ,
101
102
null ,
102
103
$ confValue
103
104
],
104
- ]);
105
+ ], $ configMap ) );
105
106
106
107
$ this ->assertSame ($ expectedResult , $ this ->checker ->isReadOnly ($ path , $ scope , $ scopeCode ));
107
108
}
@@ -118,6 +119,7 @@ public function isReadonlyDataProvider()
118
119
'scopeCode ' => 'myWebsite ' ,
119
120
'confValue ' => 'value ' ,
120
121
'variables ' => [],
122
+ 'configMap ' => [],
121
123
'expectedResult ' => true ,
122
124
],
123
125
[
@@ -126,6 +128,7 @@ public function isReadonlyDataProvider()
126
128
'scopeCode ' => 'myWebsite ' ,
127
129
'confValue ' => null ,
128
130
'variables ' => ['SOME_PLACEHOLDER ' => 'value ' ],
131
+ 'configMap ' => [],
129
132
'expectedResult ' => true ,
130
133
],
131
134
[
@@ -134,7 +137,58 @@ public function isReadonlyDataProvider()
134
137
'scopeCode ' => 'myWebsite ' ,
135
138
'confValue ' => null ,
136
139
'variables ' => [],
140
+ 'configMap ' => [],
137
141
'expectedResult ' => false ,
142
+ ],
143
+ [
144
+ 'path ' => 'general/web/locale ' ,
145
+ 'scope ' => 'website ' ,
146
+ 'scopeCode ' => 'myWebsite ' ,
147
+ 'confValue ' => null ,
148
+ 'variables ' => [],
149
+ 'configMap ' => [
150
+ [
151
+ 'system/default/general/web/locale ' ,
152
+ null ,
153
+ 'default_value ' ,
154
+ ],
155
+ ],
156
+ 'expectedResult ' => true ,
157
+ ],
158
+ [
159
+ 'path ' => 'general/web/locale ' ,
160
+ 'scope ' => 'website ' ,
161
+ 'scopeCode ' => 'myWebsite ' ,
162
+ 'confValue ' => null ,
163
+ 'variables ' => [],
164
+ 'configMap ' => [
165
+ [
166
+ 'system/default/general/web/locale ' ,
167
+ null ,
168
+ 'default_value ' ,
169
+ ],
170
+ ],
171
+ 'expectedResult ' => true ,
172
+ ],
173
+ [
174
+ 'path ' => 'general/web/locale ' ,
175
+ 'scope ' => 'store ' ,
176
+ 'scopeCode ' => 'myStore ' ,
177
+ 'confValue ' => null ,
178
+ 'variables ' => [],
179
+ 'configMap ' => [
180
+ [
181
+ 'system/default/general/web/locale ' ,
182
+ null ,
183
+ 'default_value ' ,
184
+ ],
185
+ [
186
+ 'system/website/myWebsite/general/web/locale ' ,
187
+ null ,
188
+ null ,
189
+ ],
190
+ ],
191
+ 'expectedResult ' => true ,
138
192
]
139
193
];
140
194
}
0 commit comments