File tree Expand file tree Collapse file tree 3 files changed +3
-13
lines changed
Test/Unit/Model/AdminOrder
dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder Expand file tree Collapse file tree 3 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -2091,10 +2091,8 @@ public function createOrder()
20912091 private function beforeSubmit (Quote $ quote )
20922092 {
20932093 $ orderData = [];
2094- if ($ this ->getSession ()->getReordered () || $ this -> getSession ()-> getOrder ()->getId ()) {
2094+ if ($ this ->getSession ()->getOrder ()->getId ()) {
20952095 $ oldOrder = $ this ->getSession ()->getOrder ();
2096- $ oldOrder = $ oldOrder ->getId () ?
2097- $ oldOrder : $ this ->orderRepositoryInterface ->get ($ this ->getSession ()->getReordered ());
20982096 $ originalId = $ oldOrder ->getOriginalIncrementId ();
20992097 if (!$ originalId ) {
21002098 $ originalId = $ oldOrder ->getIncrementId ();
@@ -2121,16 +2119,12 @@ private function beforeSubmit(Quote $quote)
21212119 */
21222120 private function afterSubmit (Order $ order )
21232121 {
2124- if ($ this ->getSession ()->getReordered () || $ this -> getSession ()-> getOrder ()->getId ()) {
2122+ if ($ this ->getSession ()->getOrder ()->getId ()) {
21252123 $ oldOrder = $ this ->getSession ()->getOrder ();
2126- $ oldOrder = $ oldOrder ->getId () ?
2127- $ oldOrder : $ this ->orderRepositoryInterface ->get ($ this ->getSession ()->getReordered ());
21282124 $ oldOrder ->setRelationChildId ($ order ->getId ());
21292125 $ oldOrder ->setRelationChildRealId ($ order ->getIncrementId ());
21302126 $ oldOrder ->save ();
2131- if ($ this ->getSession ()->getOrder ()->getId ()) {
2132- $ this ->orderManagement ->cancel ($ oldOrder ->getEntityId ());
2133- }
2127+ $ this ->orderManagement ->cancel ($ oldOrder ->getEntityId ());
21342128 $ order ->save ();
21352129 }
21362130 }
Original file line number Diff line number Diff line change @@ -164,7 +164,6 @@ protected function setUp(): void
164164
165165 $ this ->orderMock = $ this ->getMockBuilder (Order::class)
166166 ->disableOriginalConstructor ()
167- ->addMethods (['setReordered ' , 'getReordered ' ])
168167 ->onlyMethods (
169168 [
170169 'getEntityId ' ,
@@ -505,8 +504,6 @@ public function testInitFromOrder()
505504
506505 $ this ->orderMock ->method ('getItemsCollection ' )
507506 ->willReturn ($ itemCollectionMock );
508- $ this ->orderMock ->method ('getReordered ' )
509- ->willReturn (false );
510507 $ this ->orderMock ->method ('getShippingAddress ' )
511508 ->willReturn ($ address );
512509 $ this ->orderMock ->method ('getBillingAddress ' )
Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ public function testInitFromOrderAndCreateOrderFromQuoteWithAdditionalOptions()
9898 $ order ->loadByIncrementId ('100000001 ' );
9999
100100 /** @var $orderCreate \Magento\Sales\Model\AdminOrder\Create */
101- $ order ->setReordered (true );
102101 $ orderCreate = $ this ->model ->initFromOrder ($ order );
103102
104103 $ quoteItems = $ orderCreate ->getQuote ()->getItemsCollection ();
You can’t perform that action at this time.
0 commit comments