File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
app/code/Magento/Sales/Controller/Adminhtml/Order/Create
dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function execute()
23
23
24
24
// Clear existing order in session when creating a new order for a customer
25
25
if ($ this ->getRequest ()->getParam ('customer_id ' )) {
26
- $ this ->clearSessionOrderData ( );
26
+ $ this ->_getSession ()-> setOrderId ( null );
27
27
}
28
28
29
29
$ this ->_getOrderCreateModel ()->initRuleData ();
@@ -34,16 +34,4 @@ public function execute()
34
34
$ resultPage ->getConfig ()->getTitle ()->prepend (__ ('New Order ' ));
35
35
return $ resultPage ;
36
36
}
37
-
38
- /**
39
- * Clear order data in session
40
- *
41
- * @return $this
42
- */
43
- private function clearSessionOrderData (): self
44
- {
45
- $ this ->_getSession ()->setOrderId (null );
46
-
47
- return $ this ;
48
- }
49
37
}
Original file line number Diff line number Diff line change @@ -52,9 +52,17 @@ protected function setUp(): void
52
52
public function testExecute (): void
53
53
{
54
54
$ customerId = 1 ;
55
+ $ editingOrderId = 10 ;
56
+
55
57
$ this ->getRequest ()->setMethod (Http::METHOD_GET );
56
58
$ this ->getRequest ()->setParam ('customer_id ' , $ customerId );
59
+ $ this ->quoteSession ->setOrderId ($ editingOrderId );
60
+ $ this ->assertEquals ($ editingOrderId , $ this ->quoteSession ->getOrderId ());
57
61
$ this ->dispatch ('backend/sales/order_create/index ' );
62
+
63
+ // Check that existing order in session was cleared
64
+ $ this ->assertEquals (null , $ this ->quoteSession ->getOrderId ());
65
+
58
66
$ store = $ this ->storeManager ->getStore ();
59
67
$ this ->assertEquals ($ customerId , $ this ->quoteSession ->getCustomerId ());
60
68
$ ruleData = $ this ->registry ->registry ('rule_data ' );
You can’t perform that action at this time.
0 commit comments