Skip to content

Commit f2f39af

Browse files
author
Yuriy Denyshchenko
committed
Merge branch 'merchant_beta' of github.corp.magento.com:magento-sparta/magento2ce into MDVA-3
2 parents 3f34e03 + 2b9aecb commit f2f39af

File tree

13 files changed

+706
-388
lines changed

13 files changed

+706
-388
lines changed

app/code/Magento/Bundle/etc/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,7 @@
9090
<argument name="stockState" xsi:type="object">Magento\CatalogInventory\Api\StockStateInterface\Proxy</argument>
9191
</arguments>
9292
</type>
93+
<type name="Magento\Quote\Model\Quote\Item\ToOrderItem">
94+
<plugin name="append_bundle_data_to_order" type="Magento\Bundle\Model\Plugin\QuoteItem"/>
95+
</type>
9396
</config>

app/code/Magento/Newsletter/Model/Subscriber.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ public function subscribe($email)
399399
$this->setSubscriberConfirmCode($this->randomSequence());
400400
}
401401

402+
$sendConfirmationEmail = true;
403+
if ($this->getStatus() == self::STATUS_SUBSCRIBED && !$this->getCustomerId()) {
404+
$sendConfirmationEmail = false;
405+
}
406+
402407
$isConfirmNeed = $this->_scopeConfig->getValue(
403408
self::XML_PATH_CONFIRMATION_FLAG,
404409
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
@@ -442,12 +447,14 @@ public function subscribe($email)
442447
$this->setStatusChanged(true);
443448

444449
try {
445-
if ($isConfirmNeed === true
446-
&& $isOwnSubscribes === false
447-
) {
448-
$this->sendConfirmationRequestEmail();
449-
} else {
450-
$this->sendConfirmationSuccessEmail();
450+
if ($sendConfirmationEmail === true) {
451+
if ($isConfirmNeed === true
452+
&& $isOwnSubscribes === false
453+
) {
454+
$this->sendConfirmationRequestEmail();
455+
} else {
456+
$this->sendConfirmationSuccessEmail();
457+
}
451458
}
452459
$this->save();
453460
return $this->getStatus();

app/code/Magento/Newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testGetTransport(
9595

9696
$transport = $this->getMock('\Magento\Framework\Mail\TransportInterface');
9797

98-
$this->_mailTransportFactoryMock->expects(
98+
$this->mailTransportFactoryMock->expects(
9999
$this->at(0)
100100
)->method(
101101
'create'

app/code/Magento/User/Model/User.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ public function sendPasswordResetConfirmationEmail()
369369
{
370370
$templateId = $this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_TEMPLATE);
371371
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
372+
->setTemplateNamespace('Magento\Email\Model\BackendTemplate')
372373
->setTemplateOptions(['area' => FrontNameResolver::AREA_CODE, 'store' => Store::DEFAULT_STORE_ID])
373374
->setTemplateVars(['user' => $this, 'store' => $this->_storeManager->getStore(Store::DEFAULT_STORE_ID)])
374375
->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY))
@@ -388,6 +389,7 @@ public function sendPasswordResetNotificationEmail()
388389
{
389390
$templateId = $this->_config->getValue(self::XML_PATH_RESET_PASSWORD_TEMPLATE);
390391
$transport = $this->_transportBuilder->setTemplateIdentifier($templateId)
392+
->setTemplateNamespace('Magento\Email\Model\BackendTemplate')
391393
->setTemplateOptions(['area' => FrontNameResolver::AREA_CODE, 'store' => Store::DEFAULT_STORE_ID])
392394
->setTemplateVars(['user' => $this, 'store' => $this->_storeManager->getStore(Store::DEFAULT_STORE_ID)])
393395
->setFrom($this->_config->getValue(self::XML_PATH_FORGOT_EMAIL_IDENTITY))
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\User\Test\Unit\Model\Plugin;
8+
9+
/**
10+
* Test class for \Magento\User\Model\Plugin\AuthorizationRole testing
11+
*/
12+
class AuthorizationRoleTest extends \PHPUnit_Framework_TestCase
13+
{
14+
/** @var \Magento\User\Model\Plugin\AuthorizationRole */
15+
protected $model;
16+
17+
/** @var \Magento\User\Model\Resource\User|\PHPUnit_Framework_MockObject_MockObject */
18+
protected $userResourceModelMock;
19+
20+
/** @var \Magento\Authorization\Model\Role|\PHPUnit_Framework_MockObject_MockObject */
21+
protected $roleMock;
22+
23+
/**
24+
* Set required values
25+
*/
26+
protected function setUp()
27+
{
28+
$this->userResourceModelMock = $this->getMockBuilder('Magento\User\Model\Resource\User')
29+
->disableOriginalConstructor()
30+
->setMethods([])
31+
->getMock();
32+
33+
$this->roleMock = $this->getMockBuilder('Magento\Authorization\Model\Role')
34+
->disableOriginalConstructor()
35+
->setMethods([])
36+
->getMock();
37+
38+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
39+
$this->model = $objectManager->getObject(
40+
'Magento\User\Model\Plugin\AuthorizationRole',
41+
[
42+
'userResourceModel' => $this->userResourceModelMock
43+
]
44+
);
45+
}
46+
47+
public function testAfterSave()
48+
{
49+
$this->userResourceModelMock->expects($this->once())->method('updateRoleUsersAcl')->with($this->roleMock);
50+
$this->assertInstanceOf(
51+
'\Magento\Authorization\Model\Role',
52+
$this->model->afterSave($this->roleMock, $this->roleMock)
53+
);
54+
}
55+
}

0 commit comments

Comments
 (0)