Skip to content

Commit 6047c86

Browse files
committed
MC-21994: Integration Test failure: UploadTest::testUploadActionWithErrors
1 parent cc599e5 commit 6047c86

File tree

2 files changed

+2
-19
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Gallery

2 files changed

+2
-19
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ public function execute()
8989
['fileId' => 'image']
9090
);
9191
$uploader->setAllowedExtensions($this->getAllowedExtensions());
92-
93-
if (!$uploader->checkMimeType($this->getAllowedMimeTypes())) {
94-
throw new LocalizedException(__('Disallowed File Type.'));
95-
}
96-
9792
$imageAdapter = $this->adapterFactory->create();
9893
$uploader->addValidateCallback('catalog_product_image', $imageAdapter, 'validateUploadFile');
9994
$uploader->setAllowRenameFiles(true);
@@ -133,14 +128,4 @@ private function getAllowedExtensions()
133128
{
134129
return array_keys($this->allowedMimeTypes);
135130
}
136-
137-
/**
138-
* Get the set of allowed mime types.
139-
*
140-
* @return array
141-
*/
142-
private function getAllowedMimeTypes()
143-
{
144-
return array_values($this->allowedMimeTypes);
145-
}
146131
}

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Gallery/UploadTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ public function uploadActionDataProvider(): array
154154
*/
155155
public function testUploadActionWithErrors(array $file, array $expectation): void
156156
{
157-
$this->markTestSkipped('MC-21994');
158-
159157
if (!empty($file['create_file'])) {
160158
$this->createFileInSysTmpDir($file['name']);
161159
} elseif (!empty($file['copy_file'])) {
@@ -165,8 +163,8 @@ public function testUploadActionWithErrors(array $file, array $expectation): voi
165163
$this->getRequest()->setMethod($this->httpMethod);
166164
$this->dispatch($this->uri);
167165
$jsonBody = $this->serializer->unserialize($this->getResponse()->getBody());
168-
$this->assertEquals($jsonBody['error'], $expectation['message']);
169-
$this->assertEquals($jsonBody['errorcode'], $expectation['errorcode']);
166+
$this->assertEquals($expectation['message'], $jsonBody['error']);
167+
$this->assertEquals($expectation['errorcode'], $jsonBody['errorcode']);
170168

171169
if (!empty($expectation['tmp_media_path'])) {
172170
$this->assertFileNotExists(

0 commit comments

Comments
 (0)