@@ -211,7 +211,7 @@ protected function setUp()
211
211
$ this ->dataObjectHelperMock = $ this ->getMock ('\Magento\Framework\Api\DataObjectHelper ' , [], [], '' , false );
212
212
$ this ->checkoutSessionMock = $ this ->getMock (
213
213
'Magento\Checkout\Model\Session ' ,
214
- ['setLastQuoteId ' , 'setLastSuccessQuoteId ' , 'setLastOrderId ' , 'setLastRealOrderId ' ],
214
+ ['setLastQuoteId ' , 'setLastSuccessQuoteId ' , 'setLastOrderId ' , 'setLastRealOrderId ' , ' setLastOrderStatus ' ],
215
215
[],
216
216
'' ,
217
217
false
@@ -652,6 +652,7 @@ public function testPlaceOrderIfCustomerIsGuest()
652
652
$ cartId = 100 ;
653
653
$ orderId = 332 ;
654
654
$ orderIncrementId = 100003332 ;
655
+ $ orderStatus = 'status1 ' ;
655
656
$ email = 'email@mail.com ' ;
656
657
657
658
$ this ->quoteRepositoryMock ->expects ($ this ->once ())
@@ -710,13 +711,17 @@ public function testPlaceOrderIfCustomerIsGuest()
710
711
$ service ->expects ($ this ->once ())->method ('submit ' )->willReturn ($ orderMock );
711
712
712
713
$ this ->quoteMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ($ cartId );
714
+
713
715
$ orderMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ($ orderId );
714
716
$ orderMock ->expects ($ this ->atLeastOnce ())->method ('getIncrementId ' )->willReturn ($ orderIncrementId );
717
+ $ orderMock ->expects ($ this ->atLeastOnce ())->method ('getStatus ' )->willReturn ($ orderStatus );
715
718
716
719
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastQuoteId ' )->with ($ cartId );
717
720
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastSuccessQuoteId ' )->with ($ cartId );
718
721
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastOrderId ' )->with ($ orderId );
719
722
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastRealOrderId ' )->with ($ orderIncrementId );
723
+ $ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastOrderStatus ' )->with ($ orderStatus );
724
+
720
725
$ this ->agreementsValidatorMock ->expects ($ this ->once ())->method ('isValid ' )->willReturn (true );
721
726
722
727
$ this ->assertEquals ($ orderId , $ service ->placeOrder ($ cartId ));
@@ -763,6 +768,7 @@ public function testPlaceOrder()
763
768
$ cartId = 323 ;
764
769
$ orderId = 332 ;
765
770
$ orderIncrementId = 100003332 ;
771
+ $ orderStatus = 'status1 ' ;
766
772
767
773
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\QuoteManagement $service */
768
774
$ service = $ this ->getMock (
@@ -822,13 +828,17 @@ public function testPlaceOrder()
822
828
$ service ->expects ($ this ->once ())->method ('submit ' )->willReturn ($ orderMock );
823
829
824
830
$ this ->quoteMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ($ cartId );
831
+
825
832
$ orderMock ->expects ($ this ->atLeastOnce ())->method ('getId ' )->willReturn ($ orderId );
826
833
$ orderMock ->expects ($ this ->atLeastOnce ())->method ('getIncrementId ' )->willReturn ($ orderIncrementId );
834
+ $ orderMock ->expects ($ this ->atLeastOnce ())->method ('getStatus ' )->willReturn ($ orderStatus );
827
835
828
836
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastQuoteId ' )->with ($ cartId );
829
837
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastSuccessQuoteId ' )->with ($ cartId );
830
838
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastOrderId ' )->with ($ orderId );
831
839
$ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastRealOrderId ' )->with ($ orderIncrementId );
840
+ $ this ->checkoutSessionMock ->expects ($ this ->once ())->method ('setLastOrderStatus ' )->with ($ orderStatus );
841
+
832
842
$ this ->agreementsValidatorMock ->expects ($ this ->once ())->method ('isValid ' )->willReturn (true );
833
843
834
844
$ paymentMethod = $ this ->getMock ('Magento\Quote\Model\Quote\Payment ' , ['setChecks ' , 'getData ' ], [], '' , false );
0 commit comments