Skip to content

Commit 112d9dd

Browse files
Merge branch 2.3-develop into ENGCOM-4048-magento-magento2-20775
2 parents 104e057 + 97fd70f commit 112d9dd

File tree

37 files changed

+513
-157
lines changed

37 files changed

+513
-157
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use Magento\Backend\Block\Template\Context;
1010
use Magento\Backend\Block\Widget\Accordion;
11-
use Magento\Backend\Block\Widget\Tabs as WigetTabs;
11+
use Magento\Backend\Block\Widget\Tabs as WidgetTabs;
1212
use Magento\Backend\Model\Auth\Session;
1313
use Magento\Catalog\Helper\Catalog;
1414
use Magento\Catalog\Helper\Data;
@@ -22,7 +22,7 @@
2222
* Admin product edit tabs
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2424
*/
25-
class Tabs extends WigetTabs
25+
class Tabs extends WidgetTabs
2626
{
2727
const BASIC_TAB_GROUP_CODE = 'basic';
2828

@@ -109,7 +109,7 @@ public function __construct(
109109
}
110110

111111
/**
112-
* @return void
112+
* @inheritdoc
113113
*/
114114
protected function _construct()
115115
{
@@ -119,6 +119,8 @@ protected function _construct()
119119
}
120120

121121
/**
122+
* Get group collection.
123+
*
122124
* @param int $attributeSetId
123125
* @return \Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\Collection
124126
*/
@@ -131,10 +133,11 @@ public function getGroupCollection($attributeSetId)
131133
}
132134

133135
/**
134-
* @return $this
136+
* @inheritdoc
135137
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
136-
* @SuppressWarnings(PHPMD.NPathComplexity)
137138
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
139+
* @SuppressWarnings(PHPMD.NPathComplexity)
140+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
138141
*/
139142
protected function _prepareLayout()
140143
{
@@ -315,6 +318,8 @@ public function getAttributeTabBlock()
315318
}
316319

317320
/**
321+
* Set attribute tab block.
322+
*
318323
* @param string $attributeTabBlock
319324
* @return $this
320325
*/
@@ -337,6 +342,8 @@ protected function _translateHtml($html)
337342
}
338343

339344
/**
345+
* Get accordion.
346+
*
340347
* @param string $parentTab
341348
* @return string
342349
*/

app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<click selector="{{AdminProductFiltersSection.apply}}" stepKey="clickApplyFiltersButton"/>
2020
</actionGroup>
2121

22+
<actionGroup name="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup">
23+
<arguments>
24+
<argument name="productName" type="string"/>
25+
</arguments>
26+
<remove keyForRemoval="fillSkuFieldOnFiltersSection"/>
27+
<fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.nameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/>
28+
</actionGroup>
29+
2230
<actionGroup name="ClearProductsFilterActionGroup">
2331
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
2432
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/>

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
use Magento\Catalog\Api\Data\ProductExtensionInterface;
1010
use Magento\Catalog\Model\Product;
11+
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1112
use Magento\Framework\Api\Data\ImageContentInterface;
1213
use Magento\Framework\Api\ExtensibleDataInterface;
1314
use Magento\Framework\Api\ExtensionAttributesFactory;
1415
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
15-
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1616

1717
/**
1818
* Product Test
@@ -180,7 +180,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
180180
/**
181181
* @var \PHPUnit_Framework_MockObject_MockObject
182182
*/
183-
private $extensionAttrbutes;
183+
private $extensionAttributes;
184184

185185
/**
186186
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -200,7 +200,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
200200
/**
201201
* @var ProductExtensionInterface|\PHPUnit_Framework_MockObject_MockObject
202202
*/
203-
private $extensionAttributes;
203+
private $productExtAttributes;
204204

205205
/**
206206
* @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject
@@ -218,7 +218,7 @@ protected function setUp()
218218
\Magento\Framework\Module\Manager::class,
219219
['isEnabled']
220220
);
221-
$this->extensionAttrbutes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class)
221+
$this->extensionAttributes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class)
222222
->setMethods(['getWebsiteIds', 'setWebsiteIds'])
223223
->disableOriginalConstructor()
224224
->getMock();
@@ -372,13 +372,13 @@ protected function setUp()
372372
$this->mediaConfig = $this->createMock(\Magento\Catalog\Model\Product\Media\Config::class);
373373
$this->eavConfig = $this->createMock(\Magento\Eav\Model\Config::class);
374374

375-
$this->extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
375+
$this->productExtAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
376376
->setMethods(['getStockItem'])
377377
->getMockForAbstractClass();
378378
$this->extensionAttributesFactory
379379
->expects($this->any())
380380
->method('create')
381-
->willReturn($this->extensionAttributes);
381+
->willReturn($this->productExtAttributes);
382382

383383
$this->filterCustomAttribute = $this->createTestProxy(
384384
\Magento\Catalog\Model\FilterProductCustomAttribute::class
@@ -567,14 +567,6 @@ public function testGetCategoryId()
567567
$this->assertEquals(10, $this->model->getCategoryId());
568568
}
569569

570-
public function testGetCategoryIdWhenProductNotInCurrentCategory()
571-
{
572-
$this->model->setData('category_ids', [12]);
573-
$this->category->expects($this->once())->method('getId')->will($this->returnValue(10));
574-
$this->registry->expects($this->any())->method('registry')->will($this->returnValue($this->category));
575-
$this->assertFalse($this->model->getCategoryId());
576-
}
577-
578570
public function testGetIdBySku()
579571
{
580572
$this->resource->expects($this->once())->method('getIdBySku')->will($this->returnValue(5));

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
$showWishlist = true;
2121
$showCompare = true;
2222
$showCart = true;
23-
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
23+
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
2424
$description = false;
2525
?>
2626
<div class="block widget block-products-list <?= /* @noEscape */ $mode ?>">
@@ -48,57 +48,55 @@
4848
<?= $block->escapeHtml($_item->getName()) ?>
4949
</a>
5050
</strong>
51-
<?php
52-
echo $block->getProductPriceHtml($_item, $type);
53-
?>
54-
5551
<?php if ($templateType): ?>
5652
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
5753
<?php endif; ?>
58-
54+
<?php echo $block->getProductPriceHtml($_item, $type); ?>
5955
<?php if ($showWishlist || $showCompare || $showCart): ?>
60-
<div class="product-item-actions">
61-
<?php if ($showCart): ?>
62-
<div class="actions-primary">
63-
<?php if ($_item->isSaleable()): ?>
64-
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
65-
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
66-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
67-
</button>
56+
<div class="product-item-inner">
57+
<div class="product-item-actions">
58+
<?php if ($showCart): ?>
59+
<div class="actions-primary">
60+
<?php if ($_item->isSaleable()): ?>
61+
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
62+
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
63+
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
64+
</button>
65+
<?php else: ?>
66+
<?php
67+
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
68+
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
69+
?>
70+
<button class="action tocart primary" data-post='<?= /* @noEscape */ $postData ?>' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
71+
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
72+
</button>
73+
<?php endif; ?>
6874
<?php else: ?>
69-
<?php
70-
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
71-
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
72-
?>
73-
<button class="action tocart primary" data-post='<?= /* @noEscape */ $postData ?>' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
74-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
75-
</button>
75+
<?php if ($_item->getIsSalable()): ?>
76+
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
77+
<?php else: ?>
78+
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
79+
<?php endif; ?>
7680
<?php endif; ?>
77-
<?php else: ?>
78-
<?php if ($_item->getIsSalable()): ?>
79-
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
80-
<?php else: ?>
81-
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
81+
</div>
82+
<?php endif; ?>
83+
<?php if ($showWishlist || $showCompare): ?>
84+
<div class="actions-secondary" data-role="add-to-links">
85+
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
86+
<a href="#"
87+
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
88+
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
89+
</a>
90+
<?php endif; ?>
91+
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
92+
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
93+
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
94+
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
95+
</a>
8296
<?php endif; ?>
83-
<?php endif; ?>
84-
</div>
85-
<?php endif; ?>
86-
<?php if ($showWishlist || $showCompare): ?>
87-
<div class="actions-secondary" data-role="add-to-links">
88-
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
89-
<a href="#"
90-
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
91-
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
92-
</a>
93-
<?php endif; ?>
94-
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
95-
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
96-
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
97-
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
98-
</a>
99-
<?php endif; ?>
100-
</div>
101-
<?php endif; ?>
97+
</div>
98+
<?php endif; ?>
99+
</div>
102100
</div>
103101
<?php endif; ?>
104102
</div>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@
1919
<group value="checkout"/>
2020
</annotations>
2121
<before>
22-
<createData entity="_defaultCategory" stepKey="createCategory"/>
23-
<createData entity="defaultVirtualProduct" stepKey="createVirtualProduct">
24-
<requiredEntity createDataKey="createCategory"/>
25-
</createData>
26-
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer">
27-
<field key="group_id">1</field>
28-
</createData>
22+
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
23+
<createData entity="Customer_With_Different_Default_Billing_Shipping_Addresses" stepKey="createCustomer"/>
2924
</before>
3025
<after>
3126
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
3227
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
33-
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3428
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3529
</after>
3630
<!-- Steps -->
@@ -48,8 +42,8 @@
4842
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingcart"/>
4943
<!-- Step 4: Open Estimate Tax section -->
5044
<click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/>
51-
<see selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country_id}}" stepKey="checkCountry"/>
52-
<see selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
45+
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/>
46+
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
5347
<scrollTo selector="{{CheckoutCartSummarySection.postcode}}" stepKey="scrollToPostCodeField"/>
5448
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
5549
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getStreet()
222222
}
223223

224224
/**
225-
* Get steet line by number
225+
* Get street line by number
226226
*
227227
* @param int $number
228228
* @return string

app/code/Magento/Customer/Model/Address/AddressModelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
interface AddressModelInterface
1616
{
1717
/**
18-
* Get steet line by number
18+
* Get street line by number
1919
*
2020
* @param int $number
2121
* @return string

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<data key="city">Los Angeles</data>
130130
<data key="state">California</data>
131131
<data key="country_id">US</data>
132+
<data key="country">United States</data>
132133
<data key="postcode">90001</data>
133134
<data key="telephone">512-345-6789</data>
134135
<data key="default_billing">Yes</data>
@@ -182,4 +183,12 @@
182183
</array>
183184
<data key="state">California</data>
184185
</entity>
186+
<entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX">
187+
<data key="default_billing">false</data>
188+
<data key="default_shipping">true</data>
189+
</entity>
190+
<entity name="US_Default_Shipping_Address_CA" type="address" extends="US_Address_CA">
191+
<data key="default_billing">true</data>
192+
<data key="default_shipping">false</data>
193+
</entity>
185194
</entities>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,16 @@
166166
<data key="website_id">0</data>
167167
<requiredEntity type="address">UK_Not_Default_Address</requiredEntity>
168168
</entity>
169+
<entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer">
170+
<data key="group_id">1</data>
171+
<data key="email" unique="prefix">[email protected]</data>
172+
<data key="firstname">John</data>
173+
<data key="lastname">Doe</data>
174+
<data key="fullname">John Doe</data>
175+
<data key="password">pwdTest123!</data>
176+
<data key="store_id">0</data>
177+
<data key="website_id">0</data>
178+
<requiredEntity type="address">US_Default_Billing_Address_TX</requiredEntity>
179+
<requiredEntity type="address">US_Default_Shipping_Address_CA</requiredEntity>
180+
</entity>
169181
</entities>

0 commit comments

Comments
 (0)