This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +46
-3
lines changed
Test/Unit/Model/Config/Processor
dev/tests/integration/testsuite/Magento/Theme/Model/Config/Processor Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ public function process(array $config)
72
72
private function changeThemeFullPathToIdentifier ($ configItems )
73
73
{
74
74
$ theme = null ;
75
- if ( $ this ->arrayManager ->exists (DesignInterface::XML_PATH_THEME_ID , $ configItems )) {
76
- $ themeIdentifier = $ this -> arrayManager -> get (DesignInterface:: XML_PATH_THEME_ID , $ configItems );
75
+ $ themeIdentifier = $ this ->arrayManager ->get (DesignInterface::XML_PATH_THEME_ID , $ configItems );
76
+ if (! empty ( $ themeIdentifier )) {
77
77
if (!is_numeric ($ themeIdentifier )) {
78
78
// workaround for case when db is not available
79
79
try {
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Theme \Test \Unit \Model \Config \Processor ;
7
7
8
- use Magento \Config \App \Config \Source \DumpConfigSourceAggregated ;
9
8
use Magento \Framework \Stdlib \ArrayManager ;
10
9
use Magento \Framework \View \Design \Theme \ListInterface ;
11
10
use Magento \Theme \Model \Config \Processor \DesignTheme ;
@@ -78,6 +77,7 @@ private function prepareThemeMock()
78
77
79
78
/**
80
79
* @return array
80
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
81
81
*/
82
82
public function getDumpConfigDataProvider ()
83
83
{
@@ -163,6 +163,22 @@ public function getDumpConfigDataProvider()
163
163
],
164
164
],
165
165
],
166
+ [
167
+ [
168
+ 'websites ' => [
169
+ 'base ' => [
170
+ 'design ' => ['theme ' => ['theme_id ' => '' ]],
171
+ ],
172
+ ],
173
+ ],
174
+ [
175
+ 'websites ' => [
176
+ 'base ' => [
177
+ 'design ' => ['theme ' => ['theme_id ' => '' ]],
178
+ ],
179
+ ],
180
+ ],
181
+ ],
166
182
];
167
183
}
168
184
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Theme \Model \Config \Processor ;
7
+
8
+ use Magento \TestFramework \Helper \Bootstrap ;
9
+
10
+ class DesignThemeTest extends \PHPUnit \Framework \TestCase
11
+ {
12
+ /**
13
+ * Verifies that empty 'design/theme/theme_id' config value is processed without errors.
14
+ */
15
+ public function testProcessWithEmptyThemeId ()
16
+ {
17
+ $ designTheme = Bootstrap::getObjectManager ()->create (DesignTheme::class);
18
+
19
+ $ config = [
20
+ 'default ' => [
21
+ 'design ' => ['theme ' => ['theme_id ' => '' ]],
22
+ ],
23
+ ];
24
+
25
+ $ this ->assertEquals ($ config , $ designTheme ->process ($ config ));
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments