File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ public function createEmptyCart()
232232 $ quote ->setShippingAddress ($ this ->quoteAddressFactory ->create ());
233233
234234 try {
235+ $ quote ->getShippingAddress ()->setCollectShippingRates (true );
235236 $ this ->quoteRepository ->save ($ quote );
236237 } catch (\Exception $ e ) {
237238 throw new CouldNotSaveException (__ ('Cannot create quote ' ));
Original file line number Diff line number Diff line change @@ -246,11 +246,15 @@ public function testCreateEmptyCartAnonymous()
246246 $ quoteId = 2311 ;
247247
248248 $ quoteMock = $ this ->createMock (\Magento \Quote \Model \Quote::class);
249-
250- $ quoteAddress = $ this ->createMock (\Magento \Quote \Model \Quote \Address::class);
249+ $ quoteAddress = $ this ->createPartialMock (
250+ \Magento \Quote \Model \Quote \Address::class,
251+ ['setCollectShippingRates ' ]
252+ );
253+ $ quoteAddress ->expects ($ this ->once ())->method ('setCollectShippingRates ' )->with (true );
251254
252255 $ quoteMock ->expects ($ this ->any ())->method ('setBillingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
253256 $ quoteMock ->expects ($ this ->any ())->method ('setShippingAddress ' )->with ($ quoteAddress )->willReturnSelf ();
257+ $ quoteMock ->expects ($ this ->any ())->method ('getShippingAddress ' )->willReturn ($ quoteAddress );
254258
255259 $ this ->quoteAddressFactory ->expects ($ this ->any ())->method ('create ' )->willReturn ($ quoteAddress );
256260
You can’t perform that action at this time.
0 commit comments