@@ -66,6 +66,11 @@ protected function setUp()
66
66
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetBackendModel
67
67
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCreate
68
68
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetValue
69
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetPath
70
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScope
71
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScopeId
72
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetValue
73
+ * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsAfterLoad
69
74
* @param string $expectsValue
70
75
* @param string $className
71
76
* @dataProvider processDataProvider
@@ -75,9 +80,15 @@ public function testProcess(
75
80
$ expectsGetBackendModel ,
76
81
$ expectsCreate ,
77
82
$ expectsGetValue ,
83
+ $ expectsSetPath ,
84
+ $ expectsSetScope ,
85
+ $ expectsSetScopeId ,
86
+ $ expectsSetValue ,
87
+ $ expectsAfterLoad ,
78
88
$ expectsValue ,
79
89
$ className
80
- ) {
90
+ )
91
+ {
81
92
$ scope = 'someScope ' ;
82
93
$ scopeCode = 'someScopeCode ' ;
83
94
$ value = 'someValue ' ;
@@ -107,23 +118,23 @@ public function testProcess(
107
118
->disableOriginalConstructor ()
108
119
->setMethods (['setPath ' , 'setScope ' , 'setScopeId ' , 'setValue ' , 'getValue ' , 'afterLoad ' ])
109
120
->getMock ();
110
- $ backendModelMock ->expects ($ this -> once () )
121
+ $ backendModelMock ->expects ($ expectsSetPath )
111
122
->method ('setPath ' )
112
123
->with ($ path )
113
124
->willReturnSelf ();
114
- $ backendModelMock ->expects ($ this -> once () )
125
+ $ backendModelMock ->expects ($ expectsSetScope )
115
126
->method ('setScope ' )
116
127
->with ($ scope )
117
128
->willReturnSelf ();
118
- $ backendModelMock ->expects ($ this -> once () )
129
+ $ backendModelMock ->expects ($ expectsSetScopeId )
119
130
->method ('setScopeId ' )
120
131
->with ($ scopeCode )
121
132
->willReturnSelf ();
122
- $ backendModelMock ->expects ($ this -> once () )
133
+ $ backendModelMock ->expects ($ expectsSetValue )
123
134
->method ('setValue ' )
124
135
->with ($ value )
125
136
->willReturnSelf ();
126
- $ backendModelMock ->expects ($ this -> once () )
137
+ $ backendModelMock ->expects ($ expectsAfterLoad )
127
138
->method ('afterLoad ' )
128
139
->willReturnSelf ();
129
140
$ backendModelMock ->expects ($ expectsGetValue )
@@ -163,22 +174,38 @@ public function processDataProvider()
163
174
'expectsGetBackendModel ' => $ this ->once (),
164
175
'expectsCreate ' => $ this ->never (),
165
176
'expectsGetValue ' => $ this ->once (),
177
+ 'expectsSetPath ' => $ this ->once (),
178
+ 'expectsSetScope ' => $ this ->once (),
179
+ 'expectsSetScopeId ' => $ this ->once (),
180
+ 'expectsSetValue ' => $ this ->once (),
181
+ 'expectsAfterLoad ' => $ this ->once (),
166
182
'expectsValue ' => 'someValue ' ,
167
- 'className ' => Value::class
183
+ 'className ' => Value::class,
184
+
168
185
],
169
186
[
170
187
'hasBackendModel ' => false ,
171
188
'expectsGetBackendModel ' => $ this ->never (),
172
189
'expectsCreate ' => $ this ->once (),
173
190
'expectsGetValue ' => $ this ->once (),
191
+ 'expectsSetPath ' => $ this ->once (),
192
+ 'expectsSetScope ' => $ this ->once (),
193
+ 'expectsSetScopeId ' => $ this ->once (),
194
+ 'expectsSetValue ' => $ this ->once (),
195
+ 'expectsAfterLoad ' => $ this ->once (),
174
196
'expectsValue ' => 'someValue ' ,
175
197
'className ' => Value::class
176
198
],
177
199
[
178
200
'hasBackendModel ' => true ,
179
201
'expectsGetBackendModel ' => $ this ->once (),
180
202
'expectsCreate ' => $ this ->never (),
181
- 'expectsGetValue ' => $ this ->once (),
203
+ 'expectsGetValue ' => $ this ->never (),
204
+ 'expectsSetPath ' => $ this ->never (),
205
+ 'expectsSetScope ' => $ this ->never (),
206
+ 'expectsSetScopeId ' => $ this ->never (),
207
+ 'expectsSetValue ' => $ this ->never (),
208
+ 'expectsAfterLoad ' => $ this ->never (),
182
209
'expectsValue ' => ValueProcessor::SAFE_PLACEHOLDER ,
183
210
'className ' => Encrypted::class,
184
211
],
0 commit comments