Skip to content

Commit 21955c5

Browse files
committed
Fixed integration tests
1 parent 9a7a1c5 commit 21955c5

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed

app/code/Magento/MediaGallery/Model/Asset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/**
1515
* Media Gallery Asset
16+
* @SuppressWarnings(PHPMD.ExcessiveParameterList
1617
*/
1718
class Asset implements AssetInterface
1819
{

app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Psr\Log\LoggerInterface;
1818

1919
/**
20-
* Save asset keywords
20+
* Save media asset keywords to database
2121
* @deprecated use \Magento\MediaGalleryApi\Api\SaveAssetKeywordsInterface instead
2222
*/
2323
class SaveAssetKeywords implements SaveAssetKeywordsInterface

dev/tests/integration/testsuite/Magento/MediaGallery/Model/AssetEndToEndTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ public function testExecute(): void
106106
$asset = $this->assetFactory->create(
107107
[
108108
'path' => 'fruit.jpg',
109-
'contentType' => 'image'
109+
'title' => 'Img',
110+
'source' => 'Local',
111+
'contentType' => 'image/jpeg',
112+
'width' => 420,
113+
'height' => 240,
114+
'size' => 12877
110115
]
111116
);
112117
$this->saveAssets->execute([$asset]);

dev/tests/integration/testsuite/Magento/MediaGallery/Model/ResourceModel/AssetsTest.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,34 @@ public function assetsDataProvider(): array
104104
'assetsData' => [
105105
'asset1' => [
106106
'path' => 'fruit.jpg',
107-
'contentType' => 'image'
107+
'title' => 'Img',
108+
'source' => 'Local',
109+
'contentType' => 'image/jpeg',
110+
'width' => 420,
111+
'height' => 240,
112+
'size' => 12877
108113
]
109114
]
110115
],
111116
'Two assets' => [
112117
'assetsData' => [
113118
'asset1' => [
114119
'path' => 'image.jpg',
115-
'contentType' => 'image'
120+
'title' => 'Img',
121+
'source' => 'Local',
122+
'contentType' => 'image/jpeg',
123+
'width' => 420,
124+
'height' => 240,
125+
'size' => 12877
116126
],
117127
'asset2' => [
118-
'path' => 'image2.png',
119-
'contentType' => 'image'
128+
'path' => 'image2.jpg',
129+
'title' => 'Img',
130+
'source' => 'Local',
131+
'contentType' => 'image/jpeg',
132+
'width' => 420,
133+
'height' => 240,
134+
'size' => 12877
120135
]
121136
]
122137
],
@@ -133,11 +148,7 @@ private function getAssets(array $assetsData): array
133148
{
134149
$assets = [];
135150
foreach ($assetsData as $assetData) {
136-
$assets[] = $this->assetFactory->create(
137-
[
138-
'data' => $assetData
139-
]
140-
);
151+
$assets[] = $this->assetFactory->create($assetData);
141152
}
142153
return $assets;
143154
}

dev/tests/integration/testsuite/Magento/MediaGallery/_files/media_asset.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
[
1919
'id' => 2020,
2020
'path' => 'testDirectory/path.jpg',
21-
'contentType' => 'image'
21+
'contentType' => 'image',
22+
'title' => 'Img',
23+
'source' => 'Local',
24+
'width' => 420,
25+
'height' => 240,
26+
'size' => 12877
2227
]
2328
);
2429
/** @var SaveInterface $mediaSave */

0 commit comments

Comments
 (0)