File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/code/Magento/Quote/Test/Unit/Model Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ protected function setUp(): void
247247 'getPayment ' ,
248248 'setCheckoutMethod ' ,
249249 'setCustomerIsGuest ' ,
250+ 'getCustomer ' ,
250251 'getId '
251252 ]
252253 )
@@ -799,6 +800,12 @@ public function testPlaceOrderIfCustomerIsGuest()
799800 $ this ->quoteMock ->expects ($ this ->once ())
800801 ->method ('getCheckoutMethod ' )
801802 ->willReturn (Onepage::METHOD_GUEST );
803+ $ customerMock = $ this ->getMockBuilder (Customer::class)
804+ ->disableOriginalConstructor ()
805+ ->getMock ();
806+ $ this ->quoteMock ->expects ($ this ->once ())
807+ ->method ('getCustomer ' )
808+ ->willReturn ($ customerMock );
802809 $ this ->quoteMock ->expects ($ this ->once ())->method ('setCustomerId ' )->with (null )->willReturnSelf ();
803810 $ this ->quoteMock ->expects ($ this ->once ())->method ('setCustomerEmail ' )->with ($ email )->willReturnSelf ();
804811
@@ -866,6 +873,9 @@ public function testPlaceOrderIfCustomerIsGuest()
866873 $ this ->assertEquals ($ orderId , $ service ->placeOrder ($ cartId ));
867874 }
868875
876+ /**
877+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
878+ */
869879 public function testPlaceOrder ()
870880 {
871881 $ cartId = 323 ;
You can’t perform that action at this time.
0 commit comments