11<?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
27
38namespace Magento \Quote \Test \Unit \Plugin ;
49
510use Magento \Framework \Event \Observer ;
611use Magento \Framework \Webapi \Rest \Request as RestRequest ;
712use Magento \Quote \Observer \SubmitObserver ;
813use Magento \Quote \Plugin \SendOrderNotification ;
14+ use PHPUnit \Framework \MockObject \MockObject ;
915use PHPUnit \Framework \TestCase ;
1016use Magento \Sales \Model \Order ;
1117use Magento \Framework \Event ;
1218
19+ /**
20+ * Unit test for SendOrderNotification plugin
21+ */
1322class 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