File tree 1 file changed +48
-0
lines changed
dev/tests/integration/testsuite/Magento/Checkout/_files
1 file changed +48
-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
+
7
+ use Magento \Customer \Api \CustomerRepositoryInterface ;
8
+ use Magento \Quote \Model \Quote ;
9
+
10
+ require __DIR__ . '/../../Customer/_files/customer.php ' ;
11
+ require __DIR__ . '/../../../Magento/Catalog/_files/products.php ' ;
12
+
13
+ $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
14
+
15
+ $ customerRepository = $ objectManager ->create (CustomerRepositoryInterface::class);
16
+ $ customer =
$ customerRepository->
get (
'[email protected] ' );
17
+
18
+ /** @var Quote $quote */
19
+ $ quote = $ objectManager ->create (Quote::class);
20
+ $ quote ->setStoreId (
21
+ 1
22
+ )->setIsActive (
23
+ true
24
+ )->setIsMultiShipping (
25
+ false
26
+ )->assignCustomer (
27
+ $ customer
28
+ )->setCheckoutMethod (
29
+ 'customer '
30
+ )->setReservedOrderId (
31
+ 'test_order_1 '
32
+ )->addProduct (
33
+ $ product
34
+ );
35
+
36
+ $ quoteRepository = $ objectManager ->get (
37
+ \Magento \Quote \Api \CartRepositoryInterface::class
38
+ );
39
+
40
+ $ quoteRepository ->save ($ quote );
41
+
42
+ /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
43
+ $ quoteIdMask = $ objectManager
44
+ ->get (\Magento \Quote \Model \QuoteIdMaskFactory::class)
45
+ ->create ();
46
+ $ quoteIdMask ->setQuoteId ($ quote ->getId ());
47
+ $ quoteIdMask ->setDataChanges (true );
48
+ $ quoteIdMask ->save ();
You can’t perform that action at this time.
0 commit comments