Skip to content

Commit e8162bc

Browse files
committed
ACP2E-1512: Env variable config not working for store views with capital letters in the code
added unit test
1 parent 731cbef commit e8162bc

File tree

1 file changed

+65
-4
lines changed

1 file changed

+65
-4
lines changed

app/code/Magento/Store/Test/Unit/App/Config/Source/RuntimeConfigSourceTest.php

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,73 @@ public function testGet()
6868
->getMock();
6969
$selectMock->expects($this->any())->method('from')->willReturnSelf();
7070
$this->connection->expects($this->any())->method('select')->willReturn($selectMock);
71-
$this->connection->expects($this->any())->method('fetchAll')->willReturn([]);
71+
$this->connection->expects($this->exactly(3))->method('fetchAll')
72+
->willReturnOnConsecutiveCalls(
73+
[
74+
'WebsiteCode' => [
75+
'website_id' => '3',
76+
'code' => 'WebsiteCode',
77+
'name' => 'website',
78+
'sort_order' => '0',
79+
'default_group_id' => '4',
80+
'is_default' => '0'
81+
]
82+
],
83+
[
84+
0 => [
85+
'group_id' => '4',
86+
'website_id' => '3',
87+
'name' => 'store',
88+
'root_category_id' => '2',
89+
'default_store_id' => '11',
90+
'code' => 'second_website'
91+
]
92+
],
93+
[
94+
'SecondWebsite' => [
95+
'store_id' => '11',
96+
'code' => 'SECOND_WEBSITE',
97+
'website_id' => '3',
98+
'group_id' => '4',
99+
'name' => 'second',
100+
'sort_order' => '0',
101+
'is_active' => '1'
102+
]
103+
]
104+
);
72105
$this->assertEquals(
73106
[
74-
'websites' => [],
75-
'groups' => [],
76-
'stores' => [],
107+
'websites' => [
108+
'websitecode' => [
109+
'website_id' => '3',
110+
'code' => 'WebsiteCode',
111+
'name' => 'website',
112+
'sort_order' => '0',
113+
'default_group_id' => '4',
114+
'is_default' => '0'
115+
]
116+
],
117+
'groups' => [
118+
4 => [
119+
'group_id' => '4',
120+
'website_id' => '3',
121+
'name' => 'store',
122+
'root_category_id' => '2',
123+
'default_store_id' => '11',
124+
'code' => 'second_website'
125+
]
126+
],
127+
'stores' => [
128+
'second_website' => [
129+
'store_id' => '11',
130+
'code' => 'SECOND_WEBSITE',
131+
'website_id' => '3',
132+
'group_id' => '4',
133+
'name' => 'second',
134+
'sort_order' => '0',
135+
'is_active' => '1'
136+
]
137+
],
77138
],
78139
$this->configSource->get()
79140
);

0 commit comments

Comments
 (0)