Skip to content

Commit f5e74d7

Browse files
merge magento/2.4-develop into magento-honey-badgers/MC-32871
2 parents 4a3422d + def8a07 commit f5e74d7

File tree

44 files changed

+1656
-1159
lines changed

Some content is hidden

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

44 files changed

+1656
-1159
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickLogoActionGroup">
12+
<click selector="{{AdminMenuSection.logo}}" stepKey="clickLogoInAdmin"/>
13+
<waitForPageLoad stepKey="waitForAdminDashboardPageLoaded"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToSetupWizardPageActionGroup">
12+
<annotations>
13+
<description>Open Setup Wizard Page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminSetupWizardPage.url}}" stepKey="navigateToSetupWizardPage"/>
16+
<waitForPageLoad stepKey="waitForSetupWizardPageLoaded"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSetupWizardPage" url="admin/backendapp/redirect/app/setup/" area="admin" module="Magento_Backend"/>
12+
</pages>

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMenuSection">
12+
<element name="logo" type="button" selector=".menu-wrapper a.logo"/>
1213
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
1314
<element name="catalogProducts" type="button" selector="#nav li[data-ui-id='menu-magento-catalog-catalog-products']"/>
1415
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Navigate to dashboard from Setup Wizard Page"/>
15+
<title value="Navigate to dashboard after click on logo on Setup Wizard Page"/>
16+
<description value="Check navigate to dashboard after click on logo on Setup Wizard Page"/>
17+
</annotations>
18+
<before>
19+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
20+
</before>
21+
<after>
22+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
23+
</after>
24+
25+
<actionGroup ref="AdminNavigateToSetupWizardPageActionGroup" stepKey="navigateToSetupWizardPage"/>
26+
<actionGroup ref="AdminClickLogoActionGroup" stepKey="clickOnLogo"/>
27+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="checkTheDashboardPage"/>
28+
</test>
29+
</tests>

app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use Braintree\Result\Successful;
99
use Braintree\Transaction;
1010
use Braintree\Transaction\PayPalDetails;
11-
use Magento\Braintree\Gateway\SubjectReader;
1211
use Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler;
12+
use Magento\Braintree\Gateway\SubjectReader;
1313
use Magento\Framework\Intl\DateTimeFactory;
1414
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1515
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
@@ -99,7 +99,12 @@ protected function setUp()
9999
->getMock();
100100

101101
$this->paymentExtensionMock = $this->getMockBuilder(OrderPaymentExtensionInterface::class)
102-
->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken'])
102+
->setMethods([
103+
'setVaultPaymentToken',
104+
'getVaultPaymentToken',
105+
'setNotificationMessage',
106+
'getNotificationMessage'
107+
])
103108
->disableOriginalConstructor()
104109
->getMock();
105110
$this->paymentExtensionFactoryMock = $this->getMockBuilder(OrderPaymentExtensionInterfaceFactory::class)
@@ -119,7 +124,7 @@ protected function setUp()
119124
->disableOriginalConstructor()
120125
->setMethods(['create'])
121126
->getMock();
122-
127+
123128
$this->handler = new VaultDetailsHandler(
124129
$this->paymentTokenFactoryMock,
125130
$this->paymentExtensionFactoryMock,
@@ -139,7 +144,7 @@ public function testHandle()
139144
->with($this->paymentTokenMock);
140145
$this->paymentExtensionMock->method('getVaultPaymentToken')
141146
->willReturn($this->paymentTokenMock);
142-
147+
143148
$this->paymentDataObjectMock->method('getPayment')
144149
->willReturn($this->paymentInfoMock);
145150

@@ -154,7 +159,7 @@ public function testHandle()
154159
$expirationDate = '2017-07-05 00:00:00';
155160
$this->dateTimeFactoryMock->method('create')
156161
->willReturn($dateTime);
157-
162+
158163
$this->handler->handle($this->subject, $response);
159164

160165
$extensionAttributes = $this->paymentInfoMock->getExtensionAttributes();

app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use PHPUnit_Framework_MockObject_MockObject as MockObject;
2626

2727
/**
28-
* VaultDetailsHandler Test
28+
* Verify class VaultDetailsHandler
2929
*
3030
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3131
*/
@@ -216,7 +216,12 @@ private function getConfigMock(): Config
216216
private function initPaymentExtensionAttributesMock()
217217
{
218218
$this->paymentExtension = $this->getMockBuilder(OrderPaymentExtensionInterface::class)
219-
->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken'])
219+
->setMethods([
220+
'setVaultPaymentToken',
221+
'getVaultPaymentToken',
222+
'setNotificationMessage',
223+
'getNotificationMessage'
224+
])
220225
->disableOriginalConstructor()
221226
->getMock();
222227

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,30 @@
66
namespace Magento\Bundle\Block\Catalog\Product\View\Type;
77

88
use Magento\Bundle\Model\Option;
9+
use Magento\Bundle\Model\Product\Price;
10+
use Magento\Bundle\Model\Product\PriceFactory;
11+
use Magento\Bundle\Model\Product\Type;
12+
use Magento\Catalog\Block\Product\Context;
13+
use Magento\Catalog\Block\Product\View\AbstractView;
914
use Magento\Catalog\Model\Product;
15+
use Magento\Catalog\Pricing\Price\FinalPrice;
16+
use Magento\Catalog\Pricing\Price\RegularPrice;
17+
use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor;
18+
use Magento\Framework\App\ObjectManager;
1019
use Magento\Framework\DataObject;
20+
use Magento\Framework\Json\EncoderInterface;
21+
use Magento\Framework\Locale\FormatInterface;
22+
use Magento\Framework\Stdlib\ArrayUtils;
1123

1224
/**
1325
* Catalog bundle product info block
1426
*
1527
* @api
16-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17-
* @api
1828
* @since 100.0.2
29+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1930
*/
20-
class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView
31+
class Bundle extends AbstractView
2132
{
22-
2333
/**
2434
* @var array
2535
*/
@@ -33,17 +43,17 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView
3343
protected $catalogProduct;
3444

3545
/**
36-
* @var \Magento\Bundle\Model\Product\PriceFactory
46+
* @var PriceFactory
3747
*/
3848
protected $productPriceFactory;
3949

4050
/**
41-
* @var \Magento\Framework\Json\EncoderInterface
51+
* @var EncoderInterface
4252
*/
4353
protected $jsonEncoder;
4454

4555
/**
46-
* @var \Magento\Framework\Locale\FormatInterface
56+
* @var FormatInterface
4757
*/
4858
protected $localeFormat;
4959

@@ -63,22 +73,24 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView
6373
private $optionsPosition = [];
6474

6575
/**
66-
* @param \Magento\Catalog\Block\Product\Context $context
67-
* @param \Magento\Framework\Stdlib\ArrayUtils $arrayUtils
76+
* @param Context $context
77+
* @param ArrayUtils $arrayUtils
6878
* @param \Magento\Catalog\Helper\Product $catalogProduct
69-
* @param \Magento\Bundle\Model\Product\PriceFactory $productPrice
70-
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
71-
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
79+
* @param PriceFactory $productPrice
80+
* @param EncoderInterface $jsonEncoder
81+
* @param FormatInterface $localeFormat
7282
* @param array $data
83+
* @param CollectionProcessor|null $catalogRuleProcessor
7384
*/
7485
public function __construct(
75-
\Magento\Catalog\Block\Product\Context $context,
76-
\Magento\Framework\Stdlib\ArrayUtils $arrayUtils,
86+
Context $context,
87+
ArrayUtils $arrayUtils,
7788
\Magento\Catalog\Helper\Product $catalogProduct,
78-
\Magento\Bundle\Model\Product\PriceFactory $productPrice,
79-
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
80-
\Magento\Framework\Locale\FormatInterface $localeFormat,
81-
array $data = []
89+
PriceFactory $productPrice,
90+
EncoderInterface $jsonEncoder,
91+
FormatInterface $localeFormat,
92+
array $data = [],
93+
?CollectionProcessor $catalogRuleProcessor = null
8294
) {
8395
$this->catalogProduct = $catalogProduct;
8496
$this->productPriceFactory = $productPrice;
@@ -89,22 +101,8 @@ public function __construct(
89101
$arrayUtils,
90102
$data
91103
);
92-
}
93-
94-
/**
95-
* Return catalog rule processor or creates processor if it does not exist
96-
*
97-
* @deprecated 100.2.0
98-
* @return \Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor
99-
*/
100-
private function getCatalogRuleProcessor()
101-
{
102-
if ($this->catalogRuleProcessor === null) {
103-
$this->catalogRuleProcessor = \Magento\Framework\App\ObjectManager::getInstance()
104-
->get(\Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor::class);
105-
}
106-
107-
return $this->catalogRuleProcessor;
104+
$this->catalogRuleProcessor = $catalogRuleProcessor ?? ObjectManager::getInstance()
105+
->get(CollectionProcessor::class);
108106
}
109107

110108
/**
@@ -120,7 +118,7 @@ public function getOptions($stripSelection = false)
120118
{
121119
if (!$this->options) {
122120
$product = $this->getProduct();
123-
/** @var \Magento\Bundle\Model\Product\Type $typeInstance */
121+
/** @var Type $typeInstance */
124122
$typeInstance = $product->getTypeInstance();
125123
$typeInstance->setStoreFilter($product->getStoreId(), $product);
126124

@@ -130,7 +128,7 @@ public function getOptions($stripSelection = false)
130128
$typeInstance->getOptionsIds($product),
131129
$product
132130
);
133-
$this->getCatalogRuleProcessor()->addPriceData($selectionCollection);
131+
$this->catalogRuleProcessor->addPriceData($selectionCollection);
134132
$selectionCollection->addTierPriceData();
135133

136134
$this->options = $optionCollection->appendSelections(
@@ -151,10 +149,7 @@ public function getOptions($stripSelection = false)
151149
public function hasOptions()
152150
{
153151
$this->getOptions();
154-
if (empty($this->options) || !$this->getProduct()->isSalable()) {
155-
return false;
156-
}
157-
return true;
152+
return !(empty($this->options) || !$this->getProduct()->isSalable());
158153
}
159154

160155
/**
@@ -255,7 +250,7 @@ private function getSelectionItemData(Product $product, Product $selection)
255250
->getOptionSelectionAmount($selection)
256251
->getValue();
257252

258-
$selection = [
253+
return [
259254
'qty' => $qty,
260255
'customQty' => $selection->getSelectionCanChangeQty(),
261256
'optionId' => $selection->getId(),
@@ -275,8 +270,6 @@ private function getSelectionItemData(Product $product, Product $selection)
275270
'name' => $selection->getName(),
276271
'canApplyMsrp' => false,
277272
];
278-
279-
return $selection;
280273
}
281274

282275
/**
@@ -371,16 +364,16 @@ private function getOptionItemData(Option $option, Product $product, $position)
371364
*/
372365
private function getConfigData(Product $product, array $options)
373366
{
374-
$isFixedPrice = $this->getProduct()->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED;
367+
$isFixedPrice = $this->getProduct()->getPriceType() == Price::PRICE_TYPE_FIXED;
375368

376369
$productAmount = $product
377370
->getPriceInfo()
378-
->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)
371+
->getPrice(FinalPrice::PRICE_CODE)
379372
->getPriceWithoutOption();
380373

381374
$baseProductAmount = $product
382375
->getPriceInfo()
383-
->getPrice(\Magento\Catalog\Pricing\Price\RegularPrice::PRICE_CODE)
376+
->getPrice(RegularPrice::PRICE_CODE)
384377
->getAmount();
385378

386379
$config = [

0 commit comments

Comments
 (0)