Skip to content

Commit 828e0cc

Browse files
glo23503o-dubovyk
authored andcommitted
ACP2E-3246: Customer API - Login Failures Number Not Able To Reset To 0 After Successful Login
1 parent f14bb30 commit 828e0cc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

app/code/Magento/Customer/Test/Unit/Model/CustomerAuthUpdateTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Customer\Test\Unit\Model;
99

1010
use Magento\Customer\Model\Customer as CustomerModel;
11+
use Magento\Customer\Model\CustomerFactory;
1112
use Magento\Customer\Model\CustomerAuthUpdate;
1213
use Magento\Customer\Model\CustomerRegistry;
1314
use Magento\Customer\Model\Data\CustomerSecure;
@@ -36,9 +37,9 @@ class CustomerAuthUpdateTest extends TestCase
3637
protected $customerResourceModel;
3738

3839
/**
39-
* @var CustomerModel|MockObject
40+
* @var CustomerFactory|MockObject
4041
*/
41-
protected $customerModel;
42+
protected $customerFactory;
4243

4344
/**
4445
* @var ObjectManager
@@ -56,15 +57,15 @@ protected function setUp(): void
5657
$this->createMock(CustomerRegistry::class);
5758
$this->customerResourceModel =
5859
$this->createMock(CustomerResourceModel::class);
59-
$this->customerModel =
60-
$this->createMock(CustomerModel::class);
60+
$this->customerFactory =
61+
$this->createMock(CustomerFactory::class);
6162

6263
$this->model = $this->objectManager->getObject(
6364
CustomerAuthUpdate::class,
6465
[
6566
'customerRegistry' => $this->customerRegistry,
6667
'customerResourceModel' => $this->customerResourceModel,
67-
'customerModel' => $this->customerModel
68+
'customerFactory' => $this->customerFactory
6869
]
6970
);
7071
}
@@ -115,9 +116,14 @@ public function testSaveAuth()
115116
$customerId
116117
);
117118

118-
$this->customerModel->expects($this->once())
119+
$customerModel = $this->createMock(CustomerModel::class);
120+
$customerModel->expects($this->once())
119121
->method('reindex');
120122

123+
$this->customerFactory->expects($this->once())
124+
->method('create')
125+
->willReturn($customerModel);
126+
121127
$this->model->saveAuth($customerId);
122128
}
123129
}

0 commit comments

Comments
 (0)