File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
app/code/Magento/Quote/Test/Unit/Model Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ class QuoteManagementTest extends \PHPUnit\Framework\TestCase
131
131
*/
132
132
private $ addressRepositoryMock ;
133
133
134
+ /**
135
+ * @var \PHPUnit_Framework_MockObject_MockObject
136
+ */
137
+ private $ quoteFactoryMock ;
138
+
134
139
/**
135
140
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
136
141
*/
@@ -241,10 +246,15 @@ public function testCreateEmptyCartAnonymous()
241
246
242
247
$ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
243
248
244
- $ quoteAddress = $ this ->createMock (\Magento \Quote \Model \Quote \Address::class);
249
+ $ quoteAddress = $ this ->getMockBuilder (\Magento \Quote \Model \Quote \Address::class)
250
+ ->disableOriginalConstructor ()
251
+ ->setMethods (['setCollectShippingRates ' ])
252
+ ->getMock ();
245
253
246
254
$ quoteMock ->expects ($ this ->any ())->method ('setBillingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
247
255
$ quoteMock ->expects ($ this ->any ())->method ('setShippingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
256
+ $ quoteMock ->expects ($ this ->any ())->method ('getShippingAddress ' )->willReturn ($ quoteAddress );
257
+ $ quoteAddress ->expects ($ this ->once ())->method ('setCollectShippingRates ' )->with (true );
248
258
249
259
$ this ->quoteAddressFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ quoteAddress );
250
260
You can’t perform that action at this time.
0 commit comments