Skip to content

Commit 22ffe07

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-21807
2 parents 2314bd3 + 9fb7790 commit 22ffe07

File tree

128 files changed

+4660
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+4660
-752
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
4-
<h2>Welcome</h2>
4+
5+
## Welcome
56
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
67

78
## Magento System Requirements
@@ -30,7 +31,7 @@ To suggest documentation improvements, click [here][4].
3031
[4]: https://devdocs.magento.com
3132

3233
<h3>Community Maintainers</h3>
33-
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.
34+
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions.
3435

3536
<a href="https://magento.com/magento-contributors#maintainers">
3637
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>

app/code/Magento/Backup/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<label>Backup Settings</label>
1313
<field id="functionality_enabled" translate="label" type="select" sortOrder="5" showInDefault="1" showInWebsite="0" showInStore="0">
1414
<label>Enable Backup</label>
15-
<comment>Disabled by default for security reasons</comment>
15+
<comment>Disabled by default for security reasons.</comment>
1616
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
1717
</field>
1818
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">

app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<!-- Delete the simple product -->
3333
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
3434

35+
<!-- Delete a Website -->
36+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
37+
<argument name="websiteName" value="Second Website"/>
38+
</actionGroup>
39+
3540
<!-- Log out -->
3641
<actionGroup ref="logout" stepKey="logout"/>
3742
</after>
@@ -135,11 +140,6 @@
135140
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
136141
<argument name="product" value="BundleProduct"/>
137142
</actionGroup>
138-
139-
<!-- Delete created Website -->
140-
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
141-
<argument name="websiteName" value="$createWebsite.website[name]$"/>
142-
</actionGroup>
143143
</test>
144144
<test name="AdminCreateAndEditBundleProductOptionsNegativeTest">
145145
<annotations>

app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ private function getWatermark(string $type, int $scopeId = null): array
130130
);
131131

132132
if ($file) {
133-
$size = $this->scopeConfig->getValue(
134-
"design/watermark/{$type}_size",
135-
ScopeInterface::SCOPE_STORE,
136-
$scopeId
133+
$size = explode(
134+
'x',
135+
$this->scopeConfig->getValue(
136+
"design/watermark/{$type}_size",
137+
ScopeInterface::SCOPE_STORE
138+
)
137139
);
138140
$opacity = $this->scopeConfig->getValue(
139141
"design/watermark/{$type}_imageOpacity",
@@ -145,8 +147,8 @@ private function getWatermark(string $type, int $scopeId = null): array
145147
ScopeInterface::SCOPE_STORE,
146148
$scopeId
147149
);
148-
$width = !empty($size['width']) ? $size['width'] : null;
149-
$height = !empty($size['height']) ? $size['height'] : null;
150+
$width = !empty($size['0']) ? $size['0'] : null;
151+
$height = !empty($size['1']) ? $size['1'] : null;
150152

151153
return [
152154
'watermark_file' => $file,

app/code/Magento/Catalog/etc/adminhtml/system.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</field>
6666
<field id="grid_per_page" translate="label comment" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
6767
<label>Products per Page on Grid Default Value</label>
68-
<comment>Must be in the allowed values list</comment>
68+
<comment>Must be in the allowed values list.</comment>
6969
<validate>validate-per-page-value</validate>
7070
</field>
7171
<field id="list_per_page_values" translate="label comment" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
@@ -75,7 +75,7 @@
7575
</field>
7676
<field id="list_per_page" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
7777
<label>Products per Page on List Default Value</label>
78-
<comment>Must be in the allowed values list</comment>
78+
<comment>Must be in the allowed values list.</comment>
7979
<validate>validate-per-page-value</validate>
8080
</field>
8181
<field id="flat_catalog_category" translate="label" type="select" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
@@ -90,12 +90,12 @@
9090
</field>
9191
<field id="default_sort_by" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
9292
<label>Product Listing Sort by</label>
93-
<comment>Applies to category pages</comment>
93+
<comment>Applies to category pages.</comment>
9494
<source_model>Magento\Catalog\Model\Config\Source\ListSort</source_model>
9595
</field>
9696
<field id="list_allow_all" translate="label comment" type="select" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1">
9797
<label>Allow All Products per Page</label>
98-
<comment>Whether to show "All" option in the "Show X Per Page" dropdown</comment>
98+
<comment>Whether to show "All" option in the "Show X Per Page" dropdown.</comment>
9999
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
100100
</field>
101101
<field id="remember_pagination" translate="label comment" type="select" sortOrder="7" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">

app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ protected function _prepareIndexTable($entityIds = null)
292292
*/
293293
protected function _updateIndex($entityIds)
294294
{
295+
$this->deleteOldRecords($entityIds);
295296
$connection = $this->getConnection();
296297
$select = $this->_getStockStatusSelect($entityIds, true);
297298
$select = $this->getQueryProcessorComposite()->processQuery($select, $entityIds, true);
@@ -314,7 +315,6 @@ protected function _updateIndex($entityIds)
314315
}
315316
}
316317

317-
$this->deleteOldRecords($entityIds);
318318
$this->_updateIndexTable($data);
319319

320320
return $this;

app/code/Magento/CustomerGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ input CustomerInput {
6161
middlename: String @doc(description: "The customer's middle name")
6262
lastname: String @doc(description: "The customer's family name")
6363
suffix: String @doc(description: "A value such as Sr., Jr., or III")
64-
email: String! @doc(description: "The customer's email address. Required")
64+
email: String @doc(description: "The customer's email address. Required for customer creation")
6565
dob: String @doc(description: "Deprecated: Use `date_of_birth` instead")
6666
date_of_birth: String @doc(description: "The customer's date of birth")
6767
taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")

app/code/Magento/Developer/Console/Command/TablesWhitelistGenerateCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Developer\Model\Setup\Declaration\Schema\WhitelistGenerator;
1111
use Magento\Framework\Config\FileResolverByModule;
1212
use Magento\Framework\Exception\ConfigurationMismatchException;
13+
use Magento\Framework\Console\Cli;
1314
use Symfony\Component\Console\Command\Command;
1415
use Symfony\Component\Console\Input\InputInterface;
1516
use Symfony\Component\Console\Input\InputOption;
@@ -80,11 +81,12 @@ protected function execute(InputInterface $input, OutputInterface $output) : int
8081
$this->whitelistGenerator->generate($moduleName);
8182
} catch (ConfigurationMismatchException $e) {
8283
$output->writeln($e->getMessage());
83-
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
84+
return Cli::RETURN_FAILURE;
8485
} catch (\Exception $e) {
85-
return \Magento\Framework\Console\Cli::RETURN_FAILURE;
86+
$output->writeln($e->getMessage());
87+
return Cli::RETURN_FAILURE;
8688
}
8789

88-
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
90+
return Cli::RETURN_SUCCESS;
8991
}
9092
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Developer\Test\Unit\Console\Command;
9+
10+
use Magento\Developer\Console\Command\TablesWhitelistGenerateCommand as GenerateCommand;
11+
use Magento\Developer\Model\Setup\Declaration\Schema\WhitelistGenerator;
12+
use Magento\Framework\Console\Cli;
13+
use Magento\Framework\Exception\ConfigurationMismatchException as ConfigException;
14+
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
16+
use Symfony\Component\Console\Tester\CommandTester;
17+
18+
/**
19+
* Class TablesWhitelistGenerateCommandTest
20+
*
21+
* @package Magento\Developer\Test\Unit\Console\Command
22+
*/
23+
class TablesWhitelistGenerateCommandTest extends TestCase
24+
{
25+
// Exception Messages!
26+
const CONFIG_EXCEPTION_MESSAGE = 'Configuration Exception Message';
27+
const EXCEPTION_MESSAGE = 'General Exception Message';
28+
29+
/** @var WhitelistGenerator|MockObject $whitelistGenerator */
30+
private $whitelistGenerator;
31+
32+
/** @var GenerateCommand $instance */
33+
private $instance;
34+
35+
protected function setUp()
36+
{
37+
$this->whitelistGenerator = $this->getMockBuilder(WhitelistGenerator::class)
38+
->disableOriginalConstructor()
39+
->getMock();
40+
41+
$this->instance = new GenerateCommand($this->whitelistGenerator);
42+
}
43+
44+
/**
45+
* Test case for success scenario
46+
*
47+
* @param string $arguments
48+
* @param string $expected
49+
*
50+
* @dataProvider successDataProvider
51+
*/
52+
public function testCommandSuccess(string $arguments, string $expected)
53+
{
54+
$this->whitelistGenerator->expects($this->once())
55+
->method('generate')
56+
->with($arguments);
57+
58+
$commandTest = $this->execute($arguments);
59+
$this->assertEquals($expected, $commandTest->getStatusCode());
60+
$this->assertEquals('', $commandTest->getDisplay());
61+
}
62+
63+
/**
64+
* Test case for failure scenario
65+
*
66+
* @param string $arguments
67+
* @param string $expected
68+
* @param \Exception|ConfigException $exception
69+
* @param string $output
70+
*
71+
* @dataProvider failureDataProvider
72+
*/
73+
public function testCommandFailure(string $arguments, string $expected, $exception, string $output)
74+
{
75+
$this->whitelistGenerator->expects($this->once())
76+
->method('generate')
77+
->with($arguments)
78+
->willReturnCallback(
79+
function () use ($exception) {
80+
throw $exception;
81+
}
82+
);
83+
84+
$commandTest = $this->execute($arguments);
85+
$this->assertEquals($expected, $commandTest->getStatusCode());
86+
$this->assertEquals($output . PHP_EOL, $commandTest->getDisplay());
87+
}
88+
89+
/**
90+
* Data provider for success test case
91+
*
92+
* @return array
93+
*/
94+
public function successDataProvider()
95+
{
96+
return [
97+
[
98+
'all',
99+
Cli::RETURN_SUCCESS,
100+
101+
],
102+
[
103+
'Module_Name',
104+
Cli::RETURN_SUCCESS
105+
]
106+
];
107+
}
108+
109+
/**
110+
* Data provider for failure test case
111+
*
112+
* @return array
113+
*/
114+
public function failureDataProvider()
115+
{
116+
return [
117+
[
118+
'all',
119+
Cli::RETURN_FAILURE,
120+
new ConfigException(__('Configuration Exception Message')),
121+
self::CONFIG_EXCEPTION_MESSAGE
122+
],
123+
[
124+
'Module_Name',
125+
Cli::RETURN_FAILURE,
126+
new ConfigException(__('Configuration Exception Message')),
127+
self::CONFIG_EXCEPTION_MESSAGE
128+
],
129+
[
130+
'all',
131+
Cli::RETURN_FAILURE,
132+
new \Exception(self::EXCEPTION_MESSAGE),
133+
self::EXCEPTION_MESSAGE
134+
],
135+
[
136+
'Module_Name',
137+
Cli::RETURN_FAILURE,
138+
new \Exception(self::EXCEPTION_MESSAGE),
139+
self::EXCEPTION_MESSAGE
140+
]
141+
];
142+
}
143+
144+
/**
145+
* Execute command test class for symphony
146+
*
147+
* @param string $arguments
148+
*
149+
* @return CommandTester
150+
*/
151+
private function execute(string $arguments)
152+
{
153+
$commandTest = new CommandTester($this->instance);
154+
$commandTest->execute(['--' . GenerateCommand::MODULE_NAME_KEY => $arguments]);
155+
156+
return $commandTest;
157+
}
158+
}

app/code/Magento/Developer/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<label>Frontend Development Workflow</label>
1212
<field id="type" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
1313
<label>Workflow type</label>
14-
<comment>Not available in production mode</comment>
14+
<comment>Not available in production mode.</comment>
1515
<source_model>Magento\Developer\Model\Config\Source\WorkflowType</source_model>
1616
<frontend_model>Magento\Developer\Block\Adminhtml\System\Config\WorkflowType</frontend_model>
1717
<backend_model>Magento\Developer\Model\Config\Backend\WorkflowType</backend_model>

0 commit comments

Comments
 (0)