Skip to content

Commit df3c890

Browse files
author
Aleksandr Osadchyi
committed
MAGETWO-61725: [GITHUB] Improve address save flow to allow to use custom validators #7552]
1 parent cc74870 commit df3c890

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressRepositoryTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ protected function setUp()
128128
'setCustomer',
129129
'getCountryModel',
130130
'getShouldIgnoreValidation',
131+
'validate',
131132
'save',
132133
'getDataModel',
133134
'getCustomerId',
@@ -191,6 +192,9 @@ public function testSave()
191192
$this->address->expects($this->once())
192193
->method('setCustomer')
193194
->with($this->customer);
195+
$this->address->expects($this->once())
196+
->method('validate')
197+
->willReturn(true);
194198
$this->address->expects($this->once())
195199
->method('save');
196200
$this->addressRegistry->expects($this->once())
@@ -208,12 +212,6 @@ public function testSave()
208212
$this->address->expects($this->once())
209213
->method('getDataModel')
210214
->willReturn($customerAddress);
211-
$this->address->expects($this->once())
212-
->method('getShouldIgnoreValidation')
213-
->willReturn(true);
214-
$this->address->expects($this->once())
215-
->method('validate')
216-
->willReturn(true);
217215

218216
$this->repository->save($customerAddress);
219217
}

0 commit comments

Comments
 (0)