Skip to content

Commit 11b112c

Browse files
committed
MAGETWO-53814: [Backport] - Emails from admin being sent out using default config’s email, not the specific store email - for 2.1
1 parent b606ce2 commit 11b112c

File tree

6 files changed

+61
-64
lines changed

6 files changed

+61
-64
lines changed

app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,49 +73,49 @@ protected function setUp()
7373
'checkout/payment_failed/template',
7474
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
7575
8,
76-
'fixture_email_template_payment_failed'
76+
'fixture_email_template_payment_failed',
7777
],
7878
[
7979
'checkout/payment_failed/receiver',
8080
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
8181
8,
82-
'sysadmin'
82+
'sysadmin',
8383
],
8484
[
8585
'trans_email/ident_sysadmin/email',
8686
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
8787
8,
88-
'sysadmin@example.com'
88+
'sysadmin@example.com',
8989
],
9090
[
9191
'trans_email/ident_sysadmin/name',
9292
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
9393
8,
94-
'System Administrator'
94+
'System Administrator',
9595
],
9696
[
9797
'checkout/payment_failed/identity',
9898
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
9999
8,
100-
'noreply@example.com'
100+
'noreply@example.com',
101101
],
102102
[
103103
'carriers/ground/title',
104104
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
105105
null,
106-
'Ground Shipping'
106+
'Ground Shipping',
107107
],
108108
[
109109
'payment/fixture-payment-method/title',
110110
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
111111
null,
112-
'Check Money Order'
112+
'Check Money Order',
113113
],
114114
[
115115
'checkout/options/onepage_checkout_enabled',
116116
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
117117
null,
118-
'One Page Checkout'
118+
'One Page Checkout',
119119
],
120120
]
121121
)
@@ -251,7 +251,7 @@ public function testSendPaymentFailedEmail()
251251
'payment' => new \Magento\Framework\DataObject(['method' => 'fixture-payment-method']),
252252
'all_visible_items' => [
253253
new \Magento\Framework\DataObject(['product' => $productOne, 'qty' => 2]),
254-
new \Magento\Framework\DataObject(['product' => $productTwo, 'qty' => 3])
254+
new \Magento\Framework\DataObject(['product' => $productTwo, 'qty' => 3]),
255255
],
256256
]
257257
);

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ public function testCreateAccountWithPasswordInputException(
727727
AccountManagement::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER,
728728
'default',
729729
null,
730-
$minCharacterSetsNum
730+
$minCharacterSetsNum,
731731
],
732732
]
733733
)
@@ -740,14 +740,14 @@ public function testCreateAccountWithPasswordInputException(
740740

741741
if ($testNumber == 1) {
742742
$this->setExpectedException(
743-
'\Magento\Framework\Exception\InputException',
743+
\Magento\Framework\Exception\InputException::class,
744744
'Please enter a password with at least ' . $minPasswordLength . ' characters.'
745745
);
746746
}
747747

748748
if ($testNumber == 2) {
749749
$this->setExpectedException(
750-
'\Magento\Framework\Exception\InputException',
750+
\Magento\Framework\Exception\InputException::class,
751751
'Minimum of different classes of characters in password is ' . $minCharacterSetsNum .
752752
'. Classes of characters: Lower Case, Upper Case, Digits, Special Characters.'
753753
);
@@ -769,7 +769,7 @@ public function testCreateAccountInputExceptionExtraLongPassword()
769769
->willReturn(iconv_strlen($password, 'UTF-8'));
770770

771771
$this->setExpectedException(
772-
'\Magento\Framework\Exception\InputException',
772+
\Magento\Framework\Exception\InputException::class,
773773
'Please enter a password with at most 256 characters.'
774774
);
775775

@@ -822,7 +822,7 @@ public function testCreateAccountWithPassword()
822822
AccountManagement::XML_PATH_REGISTER_EMAIL_IDENTITY,
823823
ScopeInterface::SCOPE_STORE,
824824
1,
825-
$sender
825+
$sender,
826826
],
827827
]
828828
);
@@ -1397,7 +1397,7 @@ public function testChangePassword()
13971397
AccountManagement::XML_PATH_REQUIRED_CHARACTER_CLASSES_NUMBER,
13981398
'default',
13991399
null,
1400-
1
1400+
1,
14011401
],
14021402
]
14031403
);
@@ -1433,7 +1433,7 @@ public function testChangePasswordException()
14331433
->willThrowException($exception);
14341434

14351435
$this->setExpectedException(
1436-
'\Magento\Framework\Exception\InvalidEmailOrPasswordException',
1436+
\Magento\Framework\Exception\InvalidEmailOrPasswordException::class,
14371437
'Invalid login or password.'
14381438
);
14391439

@@ -1489,10 +1489,10 @@ public function testAuthenticate()
14891489
->withConsecutive(
14901490
[
14911491
'customer_customer_authenticated',
1492-
['model' => $customerModel, 'password' => $password]
1492+
['model' => $customerModel, 'password' => $password],
14931493
],
14941494
[
1495-
'customer_data_object_login', ['customer' => $customerData]
1495+
'customer_data_object_login', ['customer' => $customerData],
14961496
]
14971497
);
14981498

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function __construct(
181181
*/
182182
protected function _construct()
183183
{
184-
$this->_init('Magento\Newsletter\Model\ResourceModel\Subscriber');
184+
$this->_init(\Magento\Newsletter\Model\ResourceModel\Subscriber::class);
185185
}
186186

187187
/**

app/code/Magento/ProductAlert/Model/Email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function addStockProduct(\Magento\Catalog\Model\Product $product)
261261
protected function _getPriceBlock()
262262
{
263263
if ($this->_priceBlock === null) {
264-
$this->_priceBlock = $this->_productAlertData->createBlock('Magento\ProductAlert\Block\Email\Price');
264+
$this->_priceBlock = $this->_productAlertData->createBlock(\Magento\ProductAlert\Block\Email\Price::class);
265265
}
266266
return $this->_priceBlock;
267267
}
@@ -274,7 +274,7 @@ protected function _getPriceBlock()
274274
protected function _getStockBlock()
275275
{
276276
if ($this->_stockBlock === null) {
277-
$this->_stockBlock = $this->_productAlertData->createBlock('Magento\ProductAlert\Block\Email\Stock');
277+
$this->_stockBlock = $this->_productAlertData->createBlock(\Magento\ProductAlert\Block\Email\Stock::class);
278278
}
279279
return $this->_stockBlock;
280280
}

app/code/Magento/Wishlist/Test/Unit/Controller/Index/SendTest.php

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ class SendTest extends \PHPUnit_Framework_TestCase
115115
*/
116116
protected function setUp()
117117
{
118-
$this->resultRedirect = $this->getMockBuilder('Magento\Framework\Controller\Result\Redirect')
118+
$this->resultRedirect = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class)
119119
->disableOriginalConstructor()
120120
->getMock();
121121

122-
$this->resultLayout = $this->getMockBuilder('Magento\Framework\View\Result\Layout')
122+
$this->resultLayout = $this->getMockBuilder(\Magento\Framework\View\Result\Layout::class)
123123
->disableOriginalConstructor()
124124
->getMock();
125125

126-
$this->resultFactory = $this->getMockBuilder('Magento\Framework\Controller\ResultFactory')
126+
$this->resultFactory = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class)
127127
->disableOriginalConstructor()
128128
->getMock();
129129
$this->resultFactory->expects($this->any())
@@ -133,23 +133,23 @@ protected function setUp()
133133
[ResultFactory::TYPE_LAYOUT, [], $this->resultLayout],
134134
]);
135135

136-
$this->request = $this->getMockBuilder('Magento\Framework\App\RequestInterface')
136+
$this->request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class)
137137
->setMethods([
138138
'getPost',
139139
'getPostValue',
140140
])
141141
->getMockForAbstractClass();
142142

143-
$this->messageManager = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface')
143+
$this->messageManager = $this->getMockBuilder(\Magento\Framework\Message\ManagerInterface::class)
144144
->getMockForAbstractClass();
145145

146-
$this->url = $this->getMockBuilder('Magento\Framework\UrlInterface')
146+
$this->url = $this->getMockBuilder(\Magento\Framework\UrlInterface::class)
147147
->getMockForAbstractClass();
148148

149-
$this->eventManager = $this->getMockBuilder('Magento\Framework\Event\ManagerInterface')
149+
$this->eventManager = $this->getMockBuilder(\Magento\Framework\Event\ManagerInterface::class)
150150
->getMockForAbstractClass();
151151

152-
$this->context = $this->getMockBuilder('Magento\Framework\App\Action\Context')
152+
$this->context = $this->getMockBuilder(\Magento\Framework\App\Action\Context::class)
153153
->disableOriginalConstructor()
154154
->getMock();
155155
$this->context->expects($this->any())
@@ -168,54 +168,51 @@ protected function setUp()
168168
->method('getEventManager')
169169
->willReturn($this->eventManager);
170170

171-
$this->formKeyValidator = $this->getMockBuilder('Magento\Framework\Data\Form\FormKey\Validator')
171+
$this->formKeyValidator = $this->getMockBuilder(\Magento\Framework\Data\Form\FormKey\Validator::class)
172172
->disableOriginalConstructor()
173173
->getMock();
174174

175-
$this->customerSession = $this->getMockBuilder('Magento\Customer\Model\Session')
175+
$this->customerSession = $this->getMockBuilder(\Magento\Customer\Model\Session::class)
176176
->disableOriginalConstructor()
177177
->getMock();
178178

179-
$this->wishlistProvider = $this->getMockBuilder('Magento\Wishlist\Controller\WishlistProviderInterface')
179+
$this->wishlistProvider = $this->getMockBuilder(\Magento\Wishlist\Controller\WishlistProviderInterface::class)
180180
->getMockForAbstractClass();
181181

182-
$this->wishlistConfig = $this->getMockBuilder('Magento\Wishlist\Model\Config')
182+
$this->wishlistConfig = $this->getMockBuilder(\Magento\Wishlist\Model\Config::class)
183183
->disableOriginalConstructor()
184184
->getMock();
185185

186-
$this->transportBuilder = $this->getMockBuilder('Magento\Framework\Mail\Template\TransportBuilder')
186+
$this->transportBuilder = $this->getMockBuilder(\Magento\Framework\Mail\Template\TransportBuilder::class)
187187
->disableOriginalConstructor()
188188
->getMock();
189189

190-
$this->inlineTranslation = $this->getMockBuilder('Magento\Framework\Translate\Inline\StateInterface')
191-
->disableOriginalConstructor()
192-
->getMock();
190+
$this->inlineTranslation = $this->getMockBuilder(\Magento\Framework\Translate\Inline\StateInterface::class)
191+
->getMockForAbstractClass();
193192

194-
$this->customerViewHelper = $this->getMockBuilder('Magento\Customer\Helper\View')
193+
$this->customerViewHelper = $this->getMockBuilder(\Magento\Customer\Helper\View::class)
195194
->disableOriginalConstructor()
196195
->getMock();
197196

198-
$this->wishlistSession = $this->getMockBuilder('Magento\Framework\Session\Generic')
197+
$this->wishlistSession = $this->getMockBuilder(\Magento\Framework\Session\Generic::class)
199198
->disableOriginalConstructor()
200199
->getMock();
201200

202-
$this->scopeConfig = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface')
203-
->disableOriginalConstructor()
204-
->getMock();
201+
$this->scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config\ScopeConfigInterface::class)
202+
->getMockForAbstractClass();
205203

206-
$this->store = $this->getMockBuilder('Magento\Store\Model\Store')
204+
$this->store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
207205
->disableOriginalConstructor()
208206
->setMethods(['getStoreId'])
209207
->getMock();
210208

211-
$this->storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface')
212-
->disableOriginalConstructor()
213-
->getMock();
209+
$this->storeManager = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class)
210+
->getMockForAbstractClass();
214211
$this->storeManager->expects($this->any())
215212
->method('getStore')
216213
->willReturn($this->store);
217214

218-
$this->wishlist = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist')
215+
$this->wishlist = $this->getMockBuilder(\Magento\Wishlist\Model\Wishlist::class)
219216
->disableOriginalConstructor()
220217
->setMethods([
221218
'getShared',
@@ -227,11 +224,11 @@ protected function setUp()
227224
])
228225
->getMock();
229226

230-
$this->customerData = $this->getMockBuilder('Magento\Customer\Model\Data\Customer')
227+
$this->customerData = $this->getMockBuilder(\Magento\Customer\Model\Data\Customer::class)
231228
->disableOriginalConstructor()
232229
->getMock();
233230

234-
$this->layout = $this->getMockBuilder('Magento\Framework\View\Layout')
231+
$this->layout = $this->getMockBuilder(\Magento\Framework\View\Layout::class)
235232
->disableOriginalConstructor()
236233
->setMethods([
237234
'getBlock',
@@ -240,7 +237,7 @@ protected function setUp()
240237
])
241238
->getMock();
242239

243-
$this->transport = $this->getMockBuilder('Magento\Framework\Mail\TransportInterface')
240+
$this->transport = $this->getMockBuilder(\Magento\Framework\Mail\TransportInterface::class)
244241
->getMockForAbstractClass();
245242

246243
$this->model = new Send(

0 commit comments

Comments
 (0)