19
19
use Magento \Framework \Api \SearchCriteriaBuilder ;
20
20
use Magento \Framework \App \Filesystem \DirectoryList ;
21
21
use Magento \Framework \Exception \IntegrationException ;
22
- use Magento \Framework \Exception \LocalizedException ;
23
22
use Magento \Framework \Filesystem ;
24
23
use Magento \Framework \Filesystem \Driver \Https ;
25
24
use Magento \Framework \Filesystem \DriverInterface ;
26
25
use Magento \TestFramework \Helper \Bootstrap ;
27
26
use PHPUnit \Framework \TestCase ;
28
27
29
-
30
28
/**
31
29
* Test client for communication to Adobe Stock API.
32
30
*/
@@ -62,7 +60,7 @@ class SaveImageTest extends TestCase
62
60
/**
63
61
* @var SearchCriteriaBuilder
64
62
*/
65
- private $ searchCriteriaBuilder ;
63
+ private $ criteriaBuilder ;
66
64
67
65
/**
68
66
* @inheritdoc
@@ -72,7 +70,7 @@ protected function setUp(): void
72
70
$ this ->driver = Bootstrap::getObjectManager ()->get (DriverInterface::class);
73
71
$ this ->fileSystem = Bootstrap::getObjectManager ()->get (Filesystem::class);
74
72
$ this ->assetRepository = Bootstrap::getObjectManager ()->get (AssetRepositoryInterface::class);
75
- $ this ->searchCriteriaBuilder = Bootstrap::getObjectManager ()->get (SearchCriteriaBuilder::class);
73
+ $ this ->criteriaBuilder = Bootstrap::getObjectManager ()->get (SearchCriteriaBuilder::class);
76
74
77
75
$ this ->deleteImage ();
78
76
$ https = $ this ->createMock (Https::class);
@@ -81,8 +79,8 @@ protected function setUp(): void
81
79
->willReturnCallback (function ($ filePath ) {
82
80
return file_get_contents ($ filePath );
83
81
});
84
- $ storageSave = Bootstrap::getObjectManager ()->create (Save::class, ['driver ' => $ https, ]);
85
- $ saveImageFile = Bootstrap::getObjectManager ()->create (SaveImageFile::class, ['storageSave ' => $ storageSave, ]);
82
+ $ storageSave = Bootstrap::getObjectManager ()->create (Save::class, ['driver ' => $ https ]);
83
+ $ saveImageFile = Bootstrap::getObjectManager ()->create (SaveImageFile::class, ['storageSave ' => $ storageSave ]);
86
84
$ this ->saveImage = Bootstrap::getObjectManager ()->create (
87
85
SaveImageInterface::class,
88
86
['saveImageFile ' => $ saveImageFile ]
@@ -115,7 +113,7 @@ public function testSave(): void
115
113
$ this ->fileSystem ->getDirectoryRead (DirectoryList::MEDIA )->isExist ($ this ->saveDestination ),
116
114
'File was not saved by destination '
117
115
);
118
- $ searchCriteria = $ this ->searchCriteriaBuilder
116
+ $ searchCriteria = $ this ->criteriaBuilder
119
117
->addFilter ('creator_id ' , $ document ->getCustomAttribute ('creator_id ' )->getValue (), 'eq ' )
120
118
->create ();
121
119
self ::assertNotEmpty (
@@ -215,7 +213,6 @@ private function deleteImage(): void
215
213
{
216
214
$ mediaDir = $ this ->fileSystem ->getDirectoryWrite (DirectoryList::MEDIA );
217
215
if ($ mediaDir ->isExist ($ this ->saveDestination )) {
218
-
219
216
$ this ->driver ->deleteFile ($ mediaDir ->getAbsolutePath ($ this ->saveDestination ));
220
217
}
221
218
}
0 commit comments