Skip to content

Commit 5fd4057

Browse files
author
Mike Weis
committed
MAGETWO-31933: Can't change shipping address when creating order in backend
- enhanced unit test
1 parent d977fe1 commit 5fd4057

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,10 @@ public function testGetQuote()
231231
'setCustomerGroupId',
232232
'setIsActive',
233233
'getId',
234-
'assignCustomer',
234+
'assignCustomerWithAddressChange',
235235
'setIgnoreOldQty',
236236
'setIsSuperMode',
237+
'getAllAddresses',
237238
'__wakeup'
238239
],
239240
[],
@@ -290,14 +291,17 @@ public function testGetQuote()
290291
->with($customerId)
291292
->willReturn($dataCustomerMock);
292293
$quoteMock->expects($this->once())
293-
->method('assignCustomer')
294+
->method('assignCustomerWithAddressChange')
294295
->with($dataCustomerMock);
295296
$quoteMock->expects($this->once())
296297
->method('setIgnoreOldQty')
297298
->with(true);
298299
$quoteMock->expects($this->once())
299300
->method('setIsSuperMode')
300301
->with(true);
302+
$quoteMock->expects($this->any())
303+
->method('getAllAddresses')
304+
->will($this->returnValue([]));
301305

302306
$this->assertEquals($quoteMock, $this->quote->getQuote());
303307
}
@@ -320,9 +324,10 @@ public function testGetQuoteGet()
320324
'setCustomerGroupId',
321325
'setIsActive',
322326
'getId',
323-
'assignCustomer',
327+
'assignCustomerWithAddressChange',
324328
'setIgnoreOldQty',
325329
'setIsSuperMode',
330+
'getAllAddresses',
326331
'__wakeup'
327332
],
328333
[],
@@ -360,14 +365,17 @@ public function testGetQuoteGet()
360365
->with($customerId)
361366
->willReturn($dataCustomerMock);
362367
$quoteMock->expects($this->once())
363-
->method('assignCustomer')
368+
->method('assignCustomerWithAddressChange')
364369
->with($dataCustomerMock);
365370
$quoteMock->expects($this->once())
366371
->method('setIgnoreOldQty')
367372
->with(true);
368373
$quoteMock->expects($this->once())
369374
->method('setIsSuperMode')
370375
->with(true);
376+
$quoteMock->expects($this->any())
377+
->method('getAllAddresses')
378+
->will($this->returnValue([]));
371379

372380
$this->assertEquals($quoteMock, $this->quote->getQuote());
373381
}

0 commit comments

Comments
 (0)