Skip to content

Commit f0267fc

Browse files
committed
ACP2E-2568: Image file is Case insensitive in Pagebuilder(Image not showing in Media Gallery when upload both lowercase and uppercase image with same name)
1 parent 1952326 commit f0267fc

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/DeleteAssetsByPathsTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class DeleteAssetsByPathsTest extends TestCase
5858
public function testDeleteCorrectAssetByPathWithCaseSensitiveMatches(
5959
array $assets,
6060
string $assetPathToDelete,
61-
int $assetIdToAssert): void
62-
{
61+
int $assetIdToAssert
62+
): void {
6363
$this->adapter->expects($this->once())->method('select')->willReturn($this->select);
6464
$this->select->expects($this->once())->method('from')->willReturnSelf();
6565
$this->select->expects($this->once())->method('where')->willReturnSelf();
@@ -91,7 +91,6 @@ protected function setUp(): void
9191
$this->select = $this->createMock(Select::class);
9292
$this->statement = $this->createMock(\Zend_Db_Statement_Interface::class);
9393

94-
9594
$resourceConnection->expects($this->any())
9695
->method('getConnection')
9796
->willReturn($this->adapter);
@@ -134,7 +133,7 @@ private function getAssets(): array
134133
'id' => '1',
135134
'path' => 'catalog/category/folder/image.jpg',
136135
'title' => 'image',
137-
'description' => NULL,
136+
'description' => null,
138137
'source' => 'Local',
139138
'hash' => '20b88741b3cfa5749d414a0312c8b909aefbaa1f',
140139
'content_type' => 'image/jpg',
@@ -148,7 +147,7 @@ private function getAssets(): array
148147
'id' => '2',
149148
'path' => 'catalog/category/folder/Image.jpg',
150149
'title' => 'Image',
151-
'description' => NULL,
150+
'description' => null,
152151
'source' => 'Local',
153152
'hash' => '20b88741b3cfa5749d414a0312c8b909aefbaa1f',
154153
'content_type' => 'image/jpg',
@@ -162,7 +161,7 @@ private function getAssets(): array
162161
'id' => '3',
163162
'path' => 'catalog/category/folder/IMAGE.JPG',
164163
'title' => 'IMAGE',
165-
'description' => NULL,
164+
'description' => null,
166165
'source' => 'Local',
167166
'hash' => '93a7c1f07373afafcd4918379dacf8e3de6a3eca',
168167
'content_type' => 'image/jpg',
@@ -176,7 +175,7 @@ private function getAssets(): array
176175
'id' => '4',
177176
'path' => 'catalog/category/FOLDER/IMAGE.JPG',
178177
'title' => 'IMAGE',
179-
'description' => NULL,
178+
'description' => null,
180179
'source' => 'Local',
181180
'hash' => '93a7c1f07373afafcd4918379dacf8e3de6a3eca',
182181
'content_type' => 'image/jpg',

app/code/Magento/MediaGallery/Test/Unit/Model/ResourceModel/GetAssetsByPathsTest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GetAssetsByPathsTest extends TestCase
5252
/**
5353
* @var \Zend_Db_Statement_Interface|MockObject
5454
*/
55-
private $statement;
55+
private $statement;
5656

5757
protected function setUp(): void
5858
{
@@ -70,7 +70,6 @@ protected function setUp(): void
7070
$this->select = $this->createMock(Select::class);
7171
$this->statement = $this->createMock(\Zend_Db_Statement_Interface::class);
7272

73-
7473
$resourceConnection->expects($this->any())
7574
->method('getConnection')
7675
->willReturn($this->adapter);
@@ -85,12 +84,11 @@ protected function setUp(): void
8584
*
8685
* @dataProvider assetDeleteByPathDataProvider
8786
*/
88-
public function testGetCorrectAssetByPathWithCaseSensitiveMatches (
87+
public function testGetCorrectAssetByPathWithCaseSensitiveMatches(
8988
array $assets,
9089
int $assetIndex,
9190
int $resultsCount
92-
): void
93-
{
91+
): void {
9492
$this->adapter->expects($this->once())->method('select')->willReturn($this->select);
9593
$this->select->expects($this->once())->method('from')->willReturnSelf();
9694
$this->select->expects($this->once())->method('where')->willReturnSelf();
@@ -133,7 +131,7 @@ private function getAssets(): array
133131
'id' => '1',
134132
'path' => 'catalog/category/folder/image.jpg',
135133
'title' => 'image',
136-
'description' => NULL,
134+
'description' => null,
137135
'source' => 'Local',
138136
'hash' => '20b88741b3cfa5749d414a0312c8b909aefbaa1f',
139137
'content_type' => 'image/jpg',
@@ -147,7 +145,7 @@ private function getAssets(): array
147145
'id' => '2',
148146
'path' => 'catalog/category/folder/Image.jpg',
149147
'title' => 'Image',
150-
'description' => NULL,
148+
'description' => null,
151149
'source' => 'Local',
152150
'hash' => '20b88741b3cfa5749d414a0312c8b909aefbaa1f',
153151
'content_type' => 'image/jpg',
@@ -161,7 +159,7 @@ private function getAssets(): array
161159
'id' => '3',
162160
'path' => 'catalog/category/folder/IMAGE.JPG',
163161
'title' => 'IMAGE',
164-
'description' => NULL,
162+
'description' => null,
165163
'source' => 'Local',
166164
'hash' => '93a7c1f07373afafcd4918379dacf8e3de6a3eca',
167165
'content_type' => 'image/jpg',
@@ -175,7 +173,7 @@ private function getAssets(): array
175173
'id' => '4',
176174
'path' => 'catalog/category/FOLDER/IMAGE.JPG',
177175
'title' => 'IMAGE',
178-
'description' => NULL,
176+
'description' => null,
179177
'source' => 'Local',
180178
'hash' => '93a7c1f07373afafcd4918379dacf8e3de6a3eca',
181179
'content_type' => 'image/jpg',

0 commit comments

Comments
 (0)