Skip to content

Commit c6096ff

Browse files
Merge pull request #17176 to #17172
2 parents d2f4820 + b335d0a commit c6096ff

File tree

20 files changed

+97
-61
lines changed

20 files changed

+97
-61
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Tree/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ class Attribute extends \Magento\Backend\Block\Template
1414
/**
1515
* @var string
1616
*/
17-
protected $_template = 'catalog/product/attribute/set/main/tree/attribute.phtml';
17+
protected $_template = 'Magento_Catalog::catalog/product/attribute/set/main/tree/attribute.phtml';
1818
}

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function getElementHtml()
104104
*/
105105
public function getImages()
106106
{
107-
return $this->registry->registry('current_product')->getData('media_gallery') ?: null;
107+
return $this->getDataObject()->getData('media_gallery') ?: null;
108108
}
109109

110110
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,11 @@ public function testReindex($productChanged, $isScheduled, $productFlatCount, $c
618618
*/
619619
public function getProductReindexProvider()
620620
{
621-
return array(
621+
return [
622622
'set 1' => [true, false, 1, 1],
623623
'set 2' => [true, true, 1, 0],
624624
'set 3' => [false, false, 1, 0]
625-
);
625+
];
626626
}
627627

628628
public function testPriceReindexCallback()

app/code/Magento/Catalog/view/adminhtml/web/js/product/weight-handler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ define([
6464
},
6565

6666
/**
67-
* Has weight swither
67+
* Has weight switcher
6868
* @returns {*}
6969
*/
70-
hasWeightSwither: function () {
70+
hasWeightSwitcher: function () {
7171
return this.$weightSwitcher().is(':visible');
7272
},
7373

@@ -104,7 +104,7 @@ define([
104104
'Magento_Catalog/js/product/weight-handler': function () {
105105
this.bindAll();
106106

107-
if (this.hasWeightSwither()) {
107+
if (this.hasWeightSwitcher()) {
108108
this.switchWeight();
109109
}
110110
},

app/code/Magento/Customer/Controller/Account/LoginPost.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,27 +167,24 @@ public function execute()
167167
'This account is not confirmed. <a href="%1">Click here</a> to resend confirmation email.',
168168
$value
169169
);
170-
$this->messageManager->addError($message);
171-
$this->session->setUsername($login['username']);
172170
} catch (UserLockedException $e) {
173171
$message = __(
174172
'Invalid login or password.'
175173
);
176-
$this->messageManager->addError($message);
177-
$this->session->setUsername($login['username']);
178174
} catch (AuthenticationException $e) {
179175
$message = __('Invalid login or password.');
180-
$this->messageManager->addError($message);
181-
$this->session->setUsername($login['username']);
182176
} catch (LocalizedException $e) {
183177
$message = $e->getMessage();
184-
$this->messageManager->addError($message);
185-
$this->session->setUsername($login['username']);
186178
} catch (\Exception $e) {
187179
// PA DSS violation: throwing or logging an exception here can disclose customer password
188180
$this->messageManager->addError(
189181
__('An unspecified error occurred. Please contact us for assistance.')
190182
);
183+
} finally {
184+
if (isset($message)) {
185+
$this->messageManager->addError($message);
186+
$this->session->setUsername($login['username']);
187+
}
191188
}
192189
} else {
193190
$this->messageManager->addError(__('A login and a password are required.'));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public function testGetProductLinks()
367367
$reflectionOfExtension = new \ReflectionClass('Magento\Catalog\Api\Data\ProductLinkExtension');
368368
$method = $reflectionOfExtension->getMethod('setData');
369369
$method->setAccessible(true);
370-
$method->invokeArgs($groupExtension, array('qty', 1));
370+
$method->invokeArgs($groupExtension, ['qty', 1]);
371371

372372
$outputGroupLink = $this->objectManagerHelper->getObject('Magento\Catalog\Model\ProductLink\Link');
373373
$outputGroupLink->setProductSku("Simple Product 1");

app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function getForm()
212212
}
213213

214214
/**
215-
* Return return template name for JS
215+
* Return template name for JS
216216
*
217217
* @return string
218218
*/

app/code/Magento/Sales/Model/Order/Email/Sender.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ protected function checkAndSend(Order $order)
7878
$sender->sendCopyTo();
7979
} catch (\Exception $e) {
8080
$this->logger->error($e->getMessage());
81+
82+
return false;
8183
}
8284

8385
return true;

app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/OrderSenderTest.php

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ protected function setUp()
5959
* @param int $configValue
6060
* @param bool|null $forceSyncMode
6161
* @param bool|null $emailSendingResult
62-
* @dataProvider sendDataProvider
62+
* @param $senderSendException
6363
* @return void
64+
* @dataProvider sendDataProvider
6465
*/
65-
public function testSend($configValue, $forceSyncMode, $emailSendingResult)
66+
public function testSend($configValue, $forceSyncMode, $emailSendingResult, $senderSendException)
6667
{
6768
$address = 'address_test';
6869
$configPath = 'sales_email/general/async_sending';
@@ -122,19 +123,23 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult)
122123

123124
$this->senderMock->expects($this->once())->method('send');
124125

125-
$this->senderMock->expects($this->once())->method('sendCopyTo');
126+
if ($senderSendException) {
127+
$this->checkSenderSendExceptionCase();
128+
} else {
129+
$this->senderMock->expects($this->once())->method('sendCopyTo');
126130

127-
$this->orderMock->expects($this->once())
128-
->method('setEmailSent')
129-
->with(true);
131+
$this->orderMock->expects($this->once())
132+
->method('setEmailSent')
133+
->with(true);
130134

131-
$this->orderResourceMock->expects($this->once())
132-
->method('saveAttribute')
133-
->with($this->orderMock, ['send_email', 'email_sent']);
135+
$this->orderResourceMock->expects($this->once())
136+
->method('saveAttribute')
137+
->with($this->orderMock, ['send_email', 'email_sent']);
134138

135-
$this->assertTrue(
136-
$this->sender->send($this->orderMock)
137-
);
139+
$this->assertTrue(
140+
$this->sender->send($this->orderMock)
141+
);
142+
}
138143
} else {
139144
$this->orderResourceMock->expects($this->once())
140145
->method('saveAttribute')
@@ -155,19 +160,42 @@ public function testSend($configValue, $forceSyncMode, $emailSendingResult)
155160
}
156161
}
157162

163+
/**
164+
* Methods check case when method "send" in "senderMock" throw exception.
165+
*
166+
* @return void
167+
*/
168+
protected function checkSenderSendExceptionCase()
169+
{
170+
$this->senderMock->expects($this->once())
171+
->method('send')
172+
->willThrowException(new \Exception('exception'));
173+
174+
$this->orderResourceMock->expects($this->once())
175+
->method('saveAttribute')
176+
->with($this->orderMock, 'send_email');
177+
178+
$this->assertFalse(
179+
$this->sender->send($this->orderMock)
180+
);
181+
}
182+
158183
/**
159184
* @return array
160185
*/
161186
public function sendDataProvider()
162187
{
163188
return [
164-
[0, 0, true],
165-
[0, 0, true],
166-
[0, 0, false],
167-
[0, 0, false],
168-
[0, 1, true],
169-
[0, 1, true],
170-
[1, null, null, null]
189+
[0, 0, true, false],
190+
[0, 0, true, false],
191+
[0, 0, true, true],
192+
[0, 0, false, false],
193+
[0, 0, false, false],
194+
[0, 0, false, true],
195+
[0, 1, true, false],
196+
[0, 1, true, false],
197+
[0, 1, true, false],
198+
[1, null, null, false]
171199
];
172200
}
173201

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,23 @@ protected function clearValues(Address\Total $total)
142142
$total->setBaseTotalAmount('subtotal', 0);
143143
$total->setTotalAmount('tax', 0);
144144
$total->setBaseTotalAmount('tax', 0);
145+
$total->setTotalAmount('shipping', 0);
146+
$total->setBaseTotalAmount('shipping', 0);
145147
$total->setTotalAmount('discount_tax_compensation', 0);
146148
$total->setBaseTotalAmount('discount_tax_compensation', 0);
147149
$total->setTotalAmount('shipping_discount_tax_compensation', 0);
148150
$total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
149151
$total->setSubtotalInclTax(0);
150152
$total->setBaseSubtotalInclTax(0);
153+
$total->setShippingInclTax(0);
154+
$total->setBaseShippingInclTax(0);
155+
$total->setShippingTaxAmount(0);
156+
$total->setBaseShippingTaxAmount(0);
157+
$total->setShippingAmountForDiscount(0);
158+
$total->setBaseShippingAmountForDiscount(0);
159+
$total->setBaseShippingAmountForDiscount(0);
160+
$total->setTotalAmount('extra_tax', 0);
161+
$total->setBaseTotalAmount('extra_tax', 0);
151162
}
152163

153164
/**

0 commit comments

Comments
 (0)