Skip to content

Commit 86f1f8e

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-72487-signifyd
2 parents 5e382d7 + 14eeea2 commit 86f1f8e

39 files changed

+755
-529
lines changed

app/code/Magento/CatalogInventory/etc/events.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
<event name="sales_model_service_quote_submit_failure">
2828
<observer name="inventory" instance="Magento\CatalogInventory\Observer\RevertQuoteInventoryObserver"/>
2929
</event>
30-
<event name="restore_quote">
31-
<observer name="inventory" instance="Magento\CatalogInventory\Observer\RevertQuoteInventoryObserver"/>
32-
</event>
3330
<event name="sales_order_item_cancel">
3431
<observer name="inventory" instance="Magento\CatalogInventory\Observer\CancelOrderItemObserver"/>
3532
</event>

app/code/Magento/Customer/Setup/UpgradeData.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
159159
$this->upgradeVersionTwoZeroTwelve($customerSetup);
160160
}
161161

162+
if (version_compare($context->getVersion(), '2.0.13', '<')) {
163+
$this->upgradeVersionTwoZeroThirteen($customerSetup);
164+
}
165+
162166
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
163167
$indexer->reindexAll();
164168
$this->eavConfig->clear();
@@ -663,4 +667,36 @@ private function upgradeCustomerPasswordResetlinkExpirationPeriodConfig($setup)
663667
['path = ?' => \Magento\Customer\Model\Customer::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD]
664668
);
665669
}
670+
671+
/**
672+
* @param CustomerSetup $customerSetup
673+
*/
674+
private function upgradeVersionTwoZeroThirteen(CustomerSetup $customerSetup)
675+
{
676+
$entityAttributes = [
677+
'customer_address' => [
678+
'firstname' => [
679+
'input_filter' => 'trim'
680+
],
681+
'lastname' => [
682+
'input_filter' => 'trim'
683+
],
684+
'middlename' => [
685+
'input_filter' => 'trim'
686+
],
687+
],
688+
'customer' => [
689+
'firstname' => [
690+
'input_filter' => 'trim'
691+
],
692+
'lastname' => [
693+
'input_filter' => 'trim'
694+
],
695+
'middlename' => [
696+
'input_filter' => 'trim'
697+
],
698+
],
699+
];
700+
$this->upgradeAttributes($entityAttributes, $customerSetup);
701+
}
666702
}

app/code/Magento/Customer/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Customer" setup_version="2.0.12">
9+
<module name="Magento_Customer" setup_version="2.0.13">
1010
<sequence>
1111
<module name="Magento_Eav"/>
1212
<module name="Magento_Directory"/>

app/code/Magento/Deploy/Console/Command/SetModeCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
$modeController->enableProductionMode();
102102
}
103103
break;
104+
case State::MODE_DEFAULT:
105+
$modeController->enableDefaultMode();
106+
break;
104107
default:
105108
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
106109
}

app/code/Magento/Deploy/Model/Mode.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,25 @@ public function enableDeveloperMode()
167167
$this->setStoreMode(State::MODE_DEVELOPER);
168168
}
169169

170+
/**
171+
* Enable Default mode.
172+
*
173+
* @return void
174+
*/
175+
public function enableDefaultMode()
176+
{
177+
$this->filesystem->cleanupFilesystem(
178+
[
179+
DirectoryList::CACHE,
180+
DirectoryList::GENERATED_CODE,
181+
DirectoryList::GENERATED_METADATA,
182+
DirectoryList::TMP_MATERIALIZATION_DIR,
183+
DirectoryList::STATIC_VIEW,
184+
]
185+
);
186+
$this->setStoreMode(State::MODE_DEFAULT);
187+
}
188+
170189
/**
171190
* Get current mode information
172191
*

app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Deploy\Console\Command\SetModeCommand;
99
use Symfony\Component\Console\Tester\CommandTester;
10-
use Magento\Framework\App\State;
1110

1211
/**
1312
* @package Magento\Deploy\Test\Unit\Console\Command
@@ -67,6 +66,18 @@ public function testSetDeveloperMode()
6766
);
6867
}
6968

69+
public function testSetDefaultMode()
70+
{
71+
$this->modeMock->expects($this->once())->method('enableDefaultMode');
72+
73+
$tester = new CommandTester($this->command);
74+
$tester->execute(['mode' => 'default']);
75+
$this->assertContains(
76+
"default mode",
77+
$tester->getDisplay()
78+
);
79+
}
80+
7081
public function testSetProductionSkipCompilation()
7182
{
7283
$this->modeMock->expects($this->once())->method('enableProductionModeMinimal');

app/code/Magento/ReleaseNotification/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The **Release Notification Module** serves to provide a notification delivery pl
1515
Release notification content is maintained by Magento for each Magento version, edition, and locale. To retrieve the content, a response is returned from a request with the following parameters:
1616

1717
* **version** = The Magento version that the client has installed (ex. 2.3.0).
18-
* **edition** = The Magento edition that the client has installed (ex. Community/Enterprise/B2B).
18+
* **edition** = The Magento edition that the client has installed (ex. Community).
1919
* **locale** = The chosen locale of the admin user (ex. en_US).
2020

2121
The module will make three attempts to retrieve content for the parameters in the order listed:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<cest name="AdminConfigurationBlankIndustryCest">
12+
<annotations>
13+
<features value="Analytics"/>
14+
<stories value="Try to save empty Magento Advanced Reporting vertical"/>
15+
</annotations>
16+
<after>
17+
<amOnPage stepKey="amOnLogoutPage" url="admin/admin/auth/logout/"/>
18+
</after>
19+
<test name="AdminConfigurationBlankIndustry">
20+
<annotations>
21+
<title value="Try to save empty Magento Advanced Reporting vertical"/>
22+
<description value="An admin user cannot save a blank industry setting on the Advanced Reporting configuration page."/>
23+
<severity value="NORMAL"/>
24+
<testCaseId value="MAGETWO-63981"/>
25+
<group value="analytics"/>
26+
</annotations>
27+
<loginAsAdmin stepKey="loginAsAdmin"/>
28+
29+
<amOnPage stepKey="amOnAdminConfig" url="{{AdminConfigPage.url}}"/>
30+
<click stepKey="clickAdvancedReportingConfigMenu" selector="{{AdminConfigSection.advancedReportingMenuItem}}"/>
31+
<see stepKey="seeAdvancedReportingIndustryLabel" selector="{{AdminConfigSection.advancedReportingIndustryLabel}}" userInput="Industry"/>
32+
<selectOption stepKey="selectAdvancedReportingIndustry" selector="{{AdminConfigSection.advancedReportingIndustry}}" userInput="--Please Select--"/>
33+
<click stepKey="clickSaveConfigButton" selector="{{AdminConfigSection.saveButton}}"/>
34+
<see stepKey="seeBlankIndustryErrorMessage" selector="{{AdminConfigSection.advancedReportingBlankIndustryError}}" userInput="Please select an industry."/>
35+
</test>
36+
</cest>
37+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<cest name="AdminConfigurationEnableDisableAdvancedReportingCest">
12+
<annotations>
13+
<features value="Analytics"/>
14+
<stories value="Enable/disable Advanced Reporting"/>
15+
</annotations>
16+
<after>
17+
<amOnPage stepKey="amOnLogoutPage" url="admin/admin/auth/logout/"/>
18+
</after>
19+
<test name="EnableDisableAdvancedReporting">
20+
<annotations>
21+
<title value="Enable Disable Advanced Reporting"/>
22+
<description value="An admin user can enable/disable Advanced Reporting."/>
23+
<severity value="NORMAL"/>
24+
<testCaseId value="MAGETWO-66465"/>
25+
<group value="analytics"/>
26+
</annotations>
27+
<loginAsAdmin stepKey="loginAsAdmin"/>
28+
<!--Goto admin stores configure page -->
29+
<amOnPage stepKey="amOnAdminConfig" url="{{AdminConfigPage.url}}"/>
30+
<!--Enable Advanced Reporting-->
31+
<click stepKey="clickAdvancedReportingConfigMenu" selector="{{AdminConfigSection.advancedReportingMenuItem}}"/>
32+
<see stepKey="seeAdvancedReportingServiceLabel" selector="{{AdminConfigSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service"/>
33+
<selectOption stepKey="selectAdvancedReportingService" selector="{{AdminConfigSection.advancedReportingService}}" userInput="Enable"/>
34+
<see stepKey="seeAdvancedReportingIndustryLabel" selector="{{AdminConfigSection.advancedReportingIndustryLabel}}" userInput="Industry"/>
35+
<selectOption stepKey="selectAdvancedReportingIndustry" selector="{{AdminConfigSection.advancedReportingIndustry}}" userInput="Apps and Games"/>
36+
<click stepKey="clickSaveConfigButton" selector="{{AdminConfigSection.saveButton}}"/>
37+
<see stepKey="seeSaveConfigurationMessage" selector="{{AdminConfigSection.advancedReportingSuccessMessage}}" userInput="You saved the configuration."/>
38+
<see stepKey="seeAdvancedReportingService" selector="{{AdminConfigSection.advancedReportingService}}" userInput="Enable"/>
39+
<see stepKey="seeAdvancedReportingServiceStatus" selector="{{AdminConfigSection.advancedReportingServiceStatus}}" userInput="Subscription status: Pending"/>
40+
<!--Disable Advanced Reporting-->
41+
<see stepKey="seeAdvancedReportingServiceLabel" selector="{{AdminConfigSection.advancedReportingServiceLabel}}" userInput="Advanced Reporting Service"/>
42+
<selectOption stepKey="selectAdvancedReportingService" selector="{{AdminConfigSection.advancedReportingService}}" userInput="Disable"/>
43+
<click stepKey="clickSaveConfigButton" selector="{{AdminConfigSection.saveButton}}"/>
44+
<see stepKey="seeSaveConfigurationMessage" selector="{{AdminConfigSection.advancedReportingSuccessMessage}}" userInput="You saved the configuration."/>
45+
<see stepKey="seeAdvancedReportingService" selector="{{AdminConfigSection.advancedReportingService}}" userInput="Disable"/>
46+
<see stepKey="seeAdvancedReportingServiceStatus" selector="{{AdminConfigSection.advancedReportingServiceStatus}}" userInput="Subscription status: Disabled"/>
47+
48+
</test>
49+
</cest>
50+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<cest name="AdminConfigurationIndustryCest">
12+
<annotations>
13+
<features value="Analytics"/>
14+
<stories value="Set Magento Advanced reporting industry"/>
15+
</annotations>
16+
<after>
17+
<amOnPage stepKey="amOnLogoutPage" url="admin/admin/auth/logout/"/>
18+
</after>
19+
<test name="AdminConfigurationIndustry">
20+
<annotations>
21+
<title value="Set Magento Advanced reporting industry"/>
22+
<description value="An admin user can change the industry setting on the Advanced Reporting configuration page."/>
23+
<severity value="NORMAL"/>
24+
<testCaseId value="MAGETWO-63898"/>
25+
<group value="analytics"/>
26+
</annotations>
27+
<loginAsAdmin stepKey="loginAsAdmin"/>
28+
29+
<amOnPage stepKey="amOnAdminConfig" url="{{AdminConfigPage.url}}"/>
30+
<click stepKey="clickAdvancedReportingConfigMenu" selector="{{AdminConfigSection.advancedReportingMenuItem}}"/>
31+
<see stepKey="seeAdvancedReportingIndustryLabel" selector="{{AdminConfigSection.advancedReportingIndustryLabel}}" userInput="Industry"/>
32+
<selectOption stepKey="selectAdvancedReportingIndustry" selector="{{AdminConfigSection.advancedReportingIndustry}}" userInput="Apps and Games"/>
33+
<click stepKey="clickSaveConfigButton" selector="{{AdminConfigSection.saveButton}}"/>
34+
<see stepKey="seeIndustrySuccessMessage" selector="{{AdminConfigSection.advancedReportingSuccessMessage}}" userInput="You saved the configuration."/>
35+
</test>
36+
</cest>
37+
</config>

0 commit comments

Comments
 (0)