File tree Expand file tree Collapse file tree 3 files changed +45
-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 +45
-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 ;
@@ -162,6 +161,22 @@ public function getDumpConfigDataProvider()
162
161
],
163
162
],
164
163
],
164
+ [
165
+ [
166
+ 'websites ' => [
167
+ 'base ' => [
168
+ 'design ' => ['theme ' => ['theme_id ' => '' ]],
169
+ ],
170
+ ],
171
+ ],
172
+ [
173
+ 'websites ' => [
174
+ 'base ' => [
175
+ 'design ' => ['theme ' => ['theme_id ' => '' ]],
176
+ ],
177
+ ],
178
+ ],
179
+ ],
165
180
],
166
181
];
167
182
}
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