Skip to content

Commit e42916e

Browse files
authored
Merge branch '2.4.7-beta1-develop' into application-server-part3
2 parents 2fb6127 + 7c7461a commit e42916e

File tree

22 files changed

+388
-312
lines changed

22 files changed

+388
-312
lines changed

app/code/Magento/Config/Model/Config/Reader/Source/Deployed/SettingChecker.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,8 @@ public function getPlaceholderValue($path, $scope, $scopeCode = null)
102102
public function getEnvValue($placeholder)
103103
{
104104
// phpcs:disable Magento2.Security.Superglobal
105-
$environment = [];
106-
foreach ($_ENV as $key => $value) {
107-
$environment[strtolower($key)] = $value;
108-
}
109-
if ($this->placeholder->isApplicable($placeholder) && isset($environment[strtolower($placeholder)])) {
110-
return $environment[strtolower($placeholder)];
105+
if ($this->placeholder->isApplicable($placeholder) && isset($_ENV[$placeholder])) {
106+
return $_ENV[$placeholder];
111107
}
112108
// phpcs:enable
113109

app/code/Magento/Config/Test/Unit/Model/Config/Reader/Source/Deployed/SettingCheckerTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ protected function setUp(): void
6969
$this->checker = new SettingChecker($this->configMock, $placeholderFactoryMock, $this->scopeCodeResolverMock);
7070
}
7171

72-
public function testGetEnvValue(): void
73-
{
74-
$_ENV = array_merge($this->env, ['SOME_PLACEHOLDER' => 0, 'another_placeholder' => 1, 'some_placeholder' => 1]);
75-
$this->placeholderMock->expects($this->any())
76-
->method('isApplicable')
77-
->willReturn(true);
78-
$this->assertSame($this->checker->getEnvValue('SOME_PLACEHOLDER'), 1);
79-
$this->assertSame($this->checker->getEnvValue('another_placeholder'), 1);
80-
}
81-
8272
/**
8373
* @param string $path
8474
* @param string $scope

app/code/Magento/Store/App/Config/Source/RuntimeConfigSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function getEntities($table, $keyField)
102102
);
103103

104104
foreach ($entities as $entity) {
105-
$data[strtolower($entity[$keyField])] = $entity;
105+
$data[$entity[$keyField]] = $entity;
106106
}
107107

108108
return $data;

app/code/Magento/Store/App/Config/Type/Scopes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function get($path = '')
7272
$path = $this->convertIdPathToCodePath($patchChunks);
7373
}
7474

75-
return $this->data->getData(strtolower($path));
75+
return $this->data->getData($path);
7676
}
7777

7878
/**

app/code/Magento/Store/Model/Config/Processor/Fallback.php

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
use Magento\Framework\DB\Adapter\TableNotFoundException;
1212
use Magento\Store\App\Config\Type\Scopes;
1313
use Magento\Store\Model\ResourceModel\Store;
14+
use Magento\Store\Model\ResourceModel\Store\AllStoresCollectionFactory;
1415
use Magento\Store\Model\ResourceModel\Website;
16+
use Magento\Store\Model\ResourceModel\Website\AllWebsitesCollection;
17+
use Magento\Store\Model\ResourceModel\Website\AllWebsitesCollectionFactory;
1518

1619
/**
1720
* Fallback through different scopes and merge them
@@ -111,13 +114,6 @@ private function prepareWebsitesConfig(
111114
array $websitesConfig
112115
) {
113116
$result = [];
114-
115-
foreach ($websitesConfig as $websiteCode => $webConfiguration) {
116-
if (!isset($websitesConfig[strtolower($websiteCode)])) {
117-
$websitesConfig[strtolower($websiteCode)] = $webConfiguration;
118-
unset($websitesConfig[$websiteCode]);
119-
}
120-
}
121117
foreach ((array)$this->websiteData as $website) {
122118
$code = $website['code'];
123119
$id = $website['website_id'];
@@ -143,12 +139,6 @@ private function prepareStoresConfig(
143139
) {
144140
$result = [];
145141

146-
foreach ($storesConfig as $storeCode => $storeConfiguration) {
147-
if (!isset($storesConfig[strtolower($storeCode)])) {
148-
$storesConfig[strtolower($storeCode)] = $storeConfiguration;
149-
unset($storesConfig[$storeCode]);
150-
}
151-
}
152142
foreach ((array)$this->storeData as $store) {
153143
$code = $store['code'];
154144
$id = $store['store_id'];
@@ -201,18 +191,5 @@ private function loadScopes(): void
201191
$this->storeData = [];
202192
$this->websiteData = [];
203193
}
204-
$this->normalizeStoreData();
205-
}
206-
207-
/**
208-
* Sets stores code to lower case
209-
*
210-
* @return void
211-
*/
212-
private function normalizeStoreData(): void
213-
{
214-
foreach ($this->storeData as $key => $store) {
215-
$this->storeData[$key]['code'] = strtolower($store['code']);
216-
}
217194
}
218195
}

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

Lines changed: 4 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -68,73 +68,12 @@ 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->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-
);
71+
$this->connection->expects($this->any())->method('fetchAll')->willReturn([]);
10572
$this->assertEquals(
10673
[
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-
],
74+
'websites' => [],
75+
'groups' => [],
76+
'stores' => [],
13877
],
13978
$this->configSource->get()
14079
);

app/code/Magento/Store/Test/Unit/Model/Config/Processor/FallbackTest.php

Lines changed: 0 additions & 154 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function setUp(): void
5454
public function testValidate(): void
5555
{
5656
$this->expectException(LocalizedException::class);
57-
$this->expectErrorMessage((string)__('Please enter a valid number in this field.'));
57+
$this->expectExceptionMessage((string)__('Please enter a valid number in this field.'));
5858
$product = $this->productFactory->create();
5959
$product->setQuantityAndStockStatus(['qty' => 'string']);
6060
$this->model->validate($product);

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function postRequestData(): array
136136
public function testAuthorizedSavingOfWithException(array $data): void
137137
{
138138
$this->expectException(AuthorizationException::class);
139-
$this->expectErrorMessage('Not allowed to edit the product\'s design attributes');
139+
$this->expectExceptionMessage('Not allowed to edit the product\'s design attributes');
140140
$this->request->setPost(new Parameters($data));
141141

142142
/** @var Product $product */

dev/tests/integration/testsuite/Magento/Catalog/Model/ProductWebsiteLinkRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testSaveWithoutWebsiteId(): void
6565
$productWebsiteLink = $this->productWebsiteLinkFactory->create();
6666
$productWebsiteLink->setSku('unique-simple-azaza');
6767
$this->expectException(InputException::class);
68-
$this->expectErrorMessage((string)__('There are not websites for assign to product'));
68+
$this->expectExceptionMessage((string)__('There are not websites for assign to product'));
6969
$this->productWebsiteLinkRepository->save($productWebsiteLink);
7070
}
7171

0 commit comments

Comments
 (0)