@@ -158,10 +158,6 @@ public function testBeforeSaveAttributeFileName()
158
158
->method ('getAbsolutePath ' )
159
159
->with ('base/path/test123.jpg ' )
160
160
->willReturn ('absolute/path/base/path/test123.jpg ' );
161
- $ mediaDirectoryMock ->expects ($ this ->once ())
162
- ->method ('isExist ' )
163
- ->with ('absolute/path/base/path/test123.jpg ' )
164
- ->willReturn (false );
165
161
166
162
$ object = new \Magento \Framework \DataObject (
167
163
[
@@ -194,12 +190,15 @@ public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir()
194
190
->method ('getUri ' )
195
191
->with (DirectoryList::MEDIA )
196
192
->willReturn ('pub/media ' );
193
+ $ mediaDirectoryMock ->expects ($ this ->once ())
194
+ ->method ('getAbsolutePath ' )
195
+ ->willReturn ('/pub/media/wysiwyg/test123.jpg ' );
197
196
198
197
$ object = new \Magento \Framework \DataObject (
199
198
[
200
199
'test_attribute ' => [
201
200
[
202
- 'name ' => '/ test123.jpg ' ,
201
+ 'name ' => 'test123.jpg ' ,
203
202
'url ' => '/pub/media/wysiwyg/test123.jpg ' ,
204
203
],
205
204
],
@@ -208,7 +207,7 @@ public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir()
208
207
209
208
$ model ->beforeSave ($ object );
210
209
211
- $ this ->assertEquals ('/pub/media/wysiwyg/ test123.jpg ' , $ object ->getTestAttribute ());
210
+ $ this ->assertEquals ('test123.jpg ' , $ object ->getTestAttribute ());
212
211
$ this ->assertEquals (
213
212
[['name ' => '/pub/media/wysiwyg/test123.jpg ' , 'url ' => '/pub/media/wysiwyg/test123.jpg ' ]],
214
213
$ object ->getData ('_additional_data_test_attribute ' )
0 commit comments