@@ -83,8 +83,7 @@ protected function setUp(): void
83
83
->disableOriginalConstructor ()
84
84
->getMock ();
85
85
86
- $ this ->uploaderFactoryMock ->expects ($ this ->any ())
87
- ->method ('create ' )
86
+ $ this ->uploaderFactoryMock ->method ('create ' )
88
87
->willReturn ($ this ->uploaderMock );
89
88
90
89
$ this ->filesystemMock ->expects ($ this ->once ())
@@ -122,8 +121,7 @@ public function testBeforeSave()
122
121
$ this ->model ->setScopeCode ($ scopeCode );
123
122
$ _FILES ['groups ' ]['tmp_name ' ][$ groupId ]['fields ' ][$ field ]['value ' ] = $ tmpFileName ;
124
123
125
- $ this ->scopeConfigMock ->expects ($ this ->any ())
126
- ->method ('getValue ' )
124
+ $ this ->scopeConfigMock ->method ('getValue ' )
127
125
->with ($ path , $ scope , $ scopeCode )
128
126
->willReturn ($ oldValue );
129
127
@@ -132,6 +130,9 @@ public function testBeforeSave()
132
130
->with (Logo::UPLOAD_DIR . '/ ' . $ oldValue )
133
131
->willReturn (true );
134
132
133
+ $ this ->uploaderMock ->method ('save ' )
134
+ ->willReturn (['file ' => $ oldValue ]);
135
+
135
136
$ this ->assertEquals ($ this ->model , $ this ->model ->beforeSave ());
136
137
}
137
138
@@ -153,8 +154,7 @@ public function testBeforeSaveWithTmpInValue()
153
154
$ this ->model ->setScope ($ scope );
154
155
$ this ->model ->setScopeCode ($ scopeCode );
155
156
156
- $ this ->scopeConfigMock ->expects ($ this ->any ())
157
- ->method ('getValue ' )
157
+ $ this ->scopeConfigMock ->method ('getValue ' )
158
158
->with ($ path , $ scope , $ scopeCode )
159
159
->willReturn ($ oldValue );
160
160
@@ -163,6 +163,9 @@ public function testBeforeSaveWithTmpInValue()
163
163
->with (Logo::UPLOAD_DIR . '/ ' . $ oldValue )
164
164
->willReturn (true );
165
165
166
+ $ this ->uploaderMock ->method ('save ' )
167
+ ->willReturn (['file ' => $ oldValue ]);
168
+
166
169
$ this ->assertEquals ($ this ->model , $ this ->model ->beforeSave ());
167
170
}
168
171
@@ -184,8 +187,7 @@ public function testBeforeSaveWithDelete()
184
187
$ this ->model ->setScope ($ scope );
185
188
$ this ->model ->setScopeCode ($ scopeCode );
186
189
187
- $ this ->scopeConfigMock ->expects ($ this ->any ())
188
- ->method ('getValue ' )
190
+ $ this ->scopeConfigMock ->method ('getValue ' )
189
191
->with ($ path , $ scope , $ scopeCode )
190
192
->willReturn ($ oldValue );
191
193
@@ -215,8 +217,7 @@ public function testBeforeSaveWithoutOldValue()
215
217
$ this ->model ->setScope ($ scope );
216
218
$ this ->model ->setScopeCode ($ scopeCode );
217
219
218
- $ this ->scopeConfigMock ->expects ($ this ->any ())
219
- ->method ('getValue ' )
220
+ $ this ->scopeConfigMock ->method ('getValue ' )
220
221
->with ($ path , $ scope , $ scopeCode )
221
222
->willReturn ($ oldValue );
222
223
0 commit comments