1919use Magento \Framework \Api \SearchCriteriaBuilder ;
2020use Magento \Framework \App \Filesystem \DirectoryList ;
2121use Magento \Framework \Exception \IntegrationException ;
22- use Magento \Framework \Exception \LocalizedException ;
2322use Magento \Framework \Filesystem ;
2423use Magento \Framework \Filesystem \Driver \Https ;
2524use Magento \Framework \Filesystem \DriverInterface ;
2625use Magento \TestFramework \Helper \Bootstrap ;
2726use PHPUnit \Framework \TestCase ;
2827
29-
3028/**
3129 * Test client for communication to Adobe Stock API.
3230 */
@@ -62,7 +60,7 @@ class SaveImageTest extends TestCase
6260 /**
6361 * @var SearchCriteriaBuilder
6462 */
65- private $ searchCriteriaBuilder ;
63+ private $ criteriaBuilder ;
6664
6765 /**
6866 * @inheritdoc
@@ -72,7 +70,7 @@ protected function setUp(): void
7270 $ this ->driver = Bootstrap::getObjectManager ()->get (DriverInterface::class);
7371 $ this ->fileSystem = Bootstrap::getObjectManager ()->get (Filesystem::class);
7472 $ this ->assetRepository = Bootstrap::getObjectManager ()->get (AssetRepositoryInterface::class);
75- $ this ->searchCriteriaBuilder = Bootstrap::getObjectManager ()->get (SearchCriteriaBuilder::class);
73+ $ this ->criteriaBuilder = Bootstrap::getObjectManager ()->get (SearchCriteriaBuilder::class);
7674
7775 $ this ->deleteImage ();
7876 $ https = $ this ->createMock (Https::class);
@@ -81,8 +79,8 @@ protected function setUp(): void
8179 ->willReturnCallback (function ($ filePath ) {
8280 return file_get_contents ($ filePath );
8381 });
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 ]);
8684 $ this ->saveImage = Bootstrap::getObjectManager ()->create (
8785 SaveImageInterface::class,
8886 ['saveImageFile ' => $ saveImageFile ]
@@ -115,7 +113,7 @@ public function testSave(): void
115113 $ this ->fileSystem ->getDirectoryRead (DirectoryList::MEDIA )->isExist ($ this ->saveDestination ),
116114 'File was not saved by destination '
117115 );
118- $ searchCriteria = $ this ->searchCriteriaBuilder
116+ $ searchCriteria = $ this ->criteriaBuilder
119117 ->addFilter ('creator_id ' , $ document ->getCustomAttribute ('creator_id ' )->getValue (), 'eq ' )
120118 ->create ();
121119 self ::assertNotEmpty (
@@ -215,7 +213,6 @@ private function deleteImage(): void
215213 {
216214 $ mediaDir = $ this ->fileSystem ->getDirectoryWrite (DirectoryList::MEDIA );
217215 if ($ mediaDir ->isExist ($ this ->saveDestination )) {
218-
219216 $ this ->driver ->deleteFile ($ mediaDir ->getAbsolutePath ($ this ->saveDestination ));
220217 }
221218 }
0 commit comments