File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
dev/tests/integration/testsuite/Magento/GiftMessage/Observer Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \GiftMessage \Observer ;
9
+
10
+ use Magento \TestFramework \Helper \Bootstrap ;
11
+ use Magento \Framework \Event \ManagerInterface ;
12
+ use Magento \Quote \Model \QuoteFactory ;
13
+ use Magento \Quote \Model \Quote ;
14
+
15
+ class SalesEventQuoteMergeTest extends \PHPUnit \Framework \TestCase
16
+ {
17
+ /**
18
+ * @magentoAppArea frontend
19
+ */
20
+ public function testQuoteMerge ()
21
+ {
22
+ $ giftMessageId = 6 ;
23
+ $ objectManager = Bootstrap::getObjectManager ();
24
+ $ eventManager = $ objectManager ->get (ManagerInterface::class);
25
+ /** @var Quote $sourceQuote */
26
+ $ sourceQuote = $ objectManager ->create (QuoteFactory::class)->create ();
27
+ $ targetQuote = clone ($ sourceQuote );
28
+ $ sourceQuote ->setGiftMessageId ($ giftMessageId );
29
+
30
+ $ eventManager ->dispatch (
31
+ 'sales_quote_merge_after ' ,
32
+ [
33
+ 'quote ' => $ targetQuote ,
34
+ 'source ' => $ sourceQuote
35
+ ]
36
+ );
37
+
38
+ self ::assertEquals ($ giftMessageId , $ targetQuote ->getGiftMessageId ());
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments