Skip to content

Commit 26d7e9e

Browse files
author
Stanislav Idolov
committed
MAGETWO-54109: Unskip Tests which Refer to Already Closed Tickets
1 parent 423ed67 commit 26d7e9e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

app/code/Magento/Quote/Test/Unit/Model/BillingAddressManagementTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ class BillingAddressManagementTest extends \PHPUnit_Framework_TestCase
4040
*/
4141
protected $addressRepository;
4242

43+
/**
44+
* @var \PHPUnit_Framework_MockObject_MockObject
45+
*/
46+
private $shippingAssignmentMock;
47+
4348
/**
4449
* @return void
4550
*/
@@ -59,6 +64,19 @@ protected function setUp()
5964
'addressRepository' => $this->addressRepository
6065
]
6166
);
67+
68+
$this->shippingAssignmentMock = $this->getMock(
69+
\Magento\Quote\Model\ShippingAddressAssignment::class,
70+
['setAddress'],
71+
[],
72+
'',
73+
false
74+
);
75+
$this->objectManager->setBackwardCompatibleProperty(
76+
$this->model,
77+
'shippingAddressAssignment',
78+
$this->shippingAssignmentMock
79+
);
6280
}
6381

6482
/**
@@ -111,6 +129,10 @@ public function testSetAddress()
111129
$quoteMock->expects($this->once())->method('setBillingAddress')->with($address)->willReturnSelf();
112130
$quoteMock->expects($this->once())->method('setDataChanges')->with(1)->willReturnSelf();
113131

132+
$this->shippingAssignmentMock->expects($this->once())
133+
->method('setAddress')
134+
->with($quoteMock, $address, $useForShipping);
135+
114136
$this->quoteRepositoryMock->expects($this->once())->method('save')->with($quoteMock);
115137
$this->assertEquals($addressId, $this->model->assign($cartId, $address, $useForShipping));
116138
}
@@ -151,6 +173,10 @@ public function testSetAddressWithInabilityToSaveQuote()
151173
$quoteMock->expects($this->once())->method('setBillingAddress')->with($address)->willReturnSelf();
152174
$quoteMock->expects($this->once())->method('setDataChanges')->with(1)->willReturnSelf();
153175

176+
$this->shippingAssignmentMock->expects($this->once())
177+
->method('setAddress')
178+
->with($quoteMock, $address, false);
179+
154180
$this->quoteRepositoryMock->expects($this->once())
155181
->method('save')
156182
->with($quoteMock)

0 commit comments

Comments
 (0)