Skip to content

Commit ae6846e

Browse files
committed
ACP2E-1200: fixed static
1 parent 280bf4c commit ae6846e

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

app/code/Magento/Quote/Plugin/SendOrderNotification.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
28

39
namespace Magento\Quote\Plugin;
410

@@ -7,10 +13,19 @@
713
use Magento\Quote\Observer\SubmitObserver;
814
use Magento\Sales\Model\Order;
915

16+
/**
17+
* Send admin order confirmation
18+
*/
1019
class SendOrderNotification
1120
{
21+
/**
22+
* @var RestRequest $request
23+
*/
1224
private RestRequest $request;
1325

26+
/**
27+
* @param RestRequest $request
28+
*/
1429
public function __construct(RestRequest $request)
1530
{
1631
$this->request = $request;

app/code/Magento/Quote/Test/Unit/Plugin/SendOrderNotificationTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
11
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
27

38
namespace Magento\Quote\Test\Unit\Plugin;
49

510
use Magento\Framework\Event\Observer;
611
use Magento\Framework\Webapi\Rest\Request as RestRequest;
712
use Magento\Quote\Observer\SubmitObserver;
813
use Magento\Quote\Plugin\SendOrderNotification;
14+
use PHPUnit\Framework\MockObject\MockObject;
915
use PHPUnit\Framework\TestCase;
1016
use Magento\Sales\Model\Order;
1117
use Magento\Framework\Event;
1218

19+
/**
20+
* Unit test for SendOrderNotification plugin
21+
*/
1322
class SendOrderNotificationTest extends TestCase
1423
{
24+
/**
25+
* @var RestRequest|RestRequest&MockObject|MockObject
26+
*/
1527
private RestRequest $request;
28+
29+
/**
30+
* @var SubmitObserver|SubmitObserver&MockObject|MockObject
31+
*/
1632
private SubmitObserver $subject;
33+
34+
/**
35+
* @var Observer|Observer&MockObject|MockObject
36+
*/
1737
private Observer $observer;
38+
39+
/**
40+
* @var SendOrderNotification
41+
*/
1842
private SendOrderNotification $notification;
1943

44+
/**
45+
* @inheritdoc
46+
*/
2047
protected function setUp(): void
2148
{
2249
$this->request = $this->createMock(RestRequest::class);
@@ -25,6 +52,9 @@ protected function setUp(): void
2552
$this->notification = new SendOrderNotification($this->request);
2653
}
2754

55+
/**
56+
* @return void
57+
*/
2858
public function testBeforeExecuteWithSendConfirmation()
2959
{
3060
$this->request->expects($this->once())->method('getPostValue')->with('order')
@@ -53,6 +83,9 @@ public function testBeforeExecuteWithSendConfirmation()
5383
$this->assertTrue($orderCheck->getCanSendNewEmailFlag());
5484
}
5585

86+
/**
87+
* @return void
88+
*/
5689
public function testBeforeExecuteWithoutSendConfirmation()
5790
{
5891
$this->request->expects($this->once())->method('getPostValue')->with('order')

0 commit comments

Comments
 (0)