Skip to content

Commit 3182759

Browse files
committed
Cover changes with unit test
1 parent 1a1ca42 commit 3182759

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public function testSave()
211211
'setFirstFailure',
212212
'setLockExpires',
213213
'save',
214+
'setGroupId'
214215
]
215216
);
216217

@@ -245,9 +246,15 @@ public function testSave()
245246
$this->customer->expects($this->atLeastOnce())
246247
->method('getId')
247248
->willReturn($customerId);
248-
$this->customer->expects($this->atLeastOnce())
249+
$this->customer->expects($this->at(4))
249250
->method('__toArray')
250251
->willReturn([]);
252+
$this->customer->expects($this->at(3))
253+
->method('__toArray')
254+
->willReturn(['group_id' => 1]);
255+
$customerModel->expects($this->once())
256+
->method('setGroupId')
257+
->with(1);
251258
$this->customerRegistry->expects($this->atLeastOnce())
252259
->method('retrieve')
253260
->with($customerId)

0 commit comments

Comments
 (0)