Skip to content

Commit 7e2e8e4

Browse files
committed
ACP2E-1353: allow image/x-icon favicon; cr comments
1 parent 402f9cf commit 7e2e8e4

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeControllerTest.php

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Theme\Controller\Adminhtml\System\Design;
77

8+
use Magento\Framework\App\Config\ScopeConfigInterface;
89
use Magento\Framework\Exception\FileSystemException;
910
use Magento\Framework\Filesystem\DirectoryList;
1011

@@ -13,6 +14,27 @@
1314
*/
1415
class ThemeControllerTest extends \Magento\TestFramework\TestCase\AbstractBackendController
1516
{
17+
/**
18+
* @var ScopeConfigInterface|mixed
19+
*/
20+
private $config;
21+
22+
/**
23+
* @var string
24+
*/
25+
private $imageAdapter;
26+
27+
/**
28+
* @inheritDoc
29+
*/
30+
protected function setUp(): void
31+
{
32+
parent::setUp();
33+
34+
$this->config = $this->_objectManager->get(ScopeConfigInterface::class);
35+
$this->imageAdapter = $this->config->getValue('dev/image/default_adapter');
36+
}
37+
1638
public function testUploadJsAction()
1739
{
1840
$name = 'simple-js-file.js';
@@ -39,14 +61,14 @@ public function testUploadFaviconAction()
3961
$this->getRequest()->setPostValue('id', $theme->getId());
4062
$this->dispatch('backend/admin/design_config_fileUploader/save');
4163
$output = $this->getResponse()->getBody();
42-
if (in_array('imagick', get_loaded_extensions())) {
43-
$this->assertStringContainsString('"error":"false"', $output);
44-
$this->assertStringContainsString($name, $output);
45-
} else {
64+
if (!in_array('imagick', get_loaded_extensions()) || $this->imageAdapter == 'GD2') {
4665
$this->assertStringContainsString(
47-
'"error":"Required PHP extension \'Imagick\' was not loaded."',
66+
'{"error":"File validation failed."',
4867
$output
4968
);
69+
} else {
70+
$this->assertStringContainsString('"error":"false"', $output);
71+
$this->assertStringContainsString($name, $output);
5072
}
5173
}
5274
}

0 commit comments

Comments
 (0)