@@ -46,33 +46,23 @@ protected function setUp()
46
46
$ this ->shippingMethodManagementMock =
47
47
$ this ->getMockBuilder ('Magento\Quote\Api\ShippingMethodManagementInterface ' )
48
48
->getMockForAbstractClass ();
49
- $ this ->quoteIdMaskFactoryMock = $ this ->getMockBuilder ('Magento\Quote\Model\QuoteIdMaskFactory ' )
50
- ->disableOriginalConstructor ()
51
- ->getMock ();
52
- $ this ->quoteIdMaskMock = $ this ->getMockBuilder ('Magento\Quote\Model\QuoteIdMask ' )
53
- ->disableOriginalConstructor ()
54
- ->getMock ();
49
+
50
+ $ this ->maskedCartId = 'f216207248d65c789b17be8545e0aa73 ' ;
51
+ $ this ->cartId = 867 ;
52
+
53
+ $ guestCartTestHelper = new GuestCartTestHelper ($ this );
54
+ list ($ this ->quoteIdMaskFactoryMock , $ this ->quoteIdMaskMock ) = $ guestCartTestHelper ->mockQuoteIdMask (
55
+ $ this ->maskedCartId ,
56
+ $ this ->cartId
57
+ );
58
+
55
59
$ this ->model = $ objectManager ->getObject (
56
60
'Magento\Quote\Model\GuestCart\GuestShippingMethodManagement ' ,
57
61
[
58
62
'shippingMethodManagement ' => $ this ->shippingMethodManagementMock ,
59
63
'quoteIdMaskFactory ' => $ this ->quoteIdMaskFactoryMock ,
60
64
]
61
65
);
62
-
63
- $ this ->maskedCartId = 'f216207248d65c789b17be8545e0aa73 ' ;
64
- $ this ->cartId = 867 ;
65
-
66
- $ this ->quoteIdMaskFactoryMock ->expects ($ this ->once ())
67
- ->method ('create ' )
68
- ->willReturn ($ this ->quoteIdMaskMock );
69
- $ this ->quoteIdMaskMock ->expects ($ this ->once ())
70
- ->method ('load ' )
71
- ->with ($ this ->maskedCartId , 'masked_id ' )
72
- ->willReturn ($ this ->quoteIdMaskMock );
73
- $ this ->quoteIdMaskMock ->expects ($ this ->once ())
74
- ->method ('getId ' )
75
- ->willReturn ($ this ->cartId );
76
66
}
77
67
78
68
public function testSet ()
0 commit comments