Skip to content

Commit 35c2251

Browse files
committed
MC-31310: Customer configuration: Password options
1 parent 0524dcf commit 35c2251

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

dev/tests/integration/testsuite/Magento/Customer/Model/EmailNotificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function setUp()
7474
$this->emailNotification = $this->objectManager->get(EmailNotificationInterface::class);
7575
$this->transportBuilder = $this->objectManager->get(TransportBuilderMock::class);
7676
$this->templateResource = $this->objectManager->get(TemplateResource::class);
77-
$this->templateFactory = $this->objectManager->create(TemplateFactory::class);
77+
$this->templateFactory = $this->objectManager->get(TemplateFactory::class);
7878
$this->mutableScopeConfig = $this->objectManager->get(MutableScopeConfigInterface::class);
7979
$this->templateCollectionFactory = $this->objectManager->get(CollectionFactory::class);
8080
}

dev/tests/integration/testsuite/Magento/Security/Model/Plugin/AccountManagementTest.php

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ public function testPluginIsRegistered(): void
8989
*/
9090
public function testMaxNumberPasswordResetRequests(): void
9191
{
92-
$email = '[email protected]';
9392
$this->prepareServerParameters();
9493
$this->expectExceptionObject(new SecurityViolationException($this->errorMessage));
95-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER);
94+
$this->accountManagement->initiatePasswordReset(
95+
96+
CustomerAccountManagement::EMAIL_REMINDER
97+
);
9698
}
9799

98100
/**
@@ -103,10 +105,12 @@ public function testMaxNumberPasswordResetRequests(): void
103105
*/
104106
public function testTimeBetweenPasswordResetRequests(): void
105107
{
106-
$email = '[email protected]';
107108
$this->prepareServerParameters();
108109
$this->expectExceptionObject(new SecurityViolationException($this->errorMessage));
109-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER);
110+
$this->accountManagement->initiatePasswordReset(
111+
112+
CustomerAccountManagement::EMAIL_REMINDER
113+
);
110114
}
111115

112116
/**
@@ -118,11 +122,12 @@ public function testTimeBetweenPasswordResetRequests(): void
118122
*/
119123
public function testPasswordResetProtectionTypeDisabled(): void
120124
{
121-
$email = '[email protected]';
122125
$this->prepareServerParameters();
123-
$this->assertTrue(
124-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER)
126+
$result = $this->accountManagement->initiatePasswordReset(
127+
128+
CustomerAccountManagement::EMAIL_REMINDER
125129
);
130+
$this->assertTrue($result);
126131
}
127132

128133
/**
@@ -134,10 +139,12 @@ public function testPasswordResetProtectionTypeDisabled(): void
134139
*/
135140
public function testPasswordResetProtectionTypeByIpAndEmail(): void
136141
{
137-
$email = '[email protected]';
138142
$this->prepareServerParameters();
139143
$this->expectExceptionObject(new SecurityViolationException($this->errorMessage));
140-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER);
144+
$this->accountManagement->initiatePasswordReset(
145+
146+
CustomerAccountManagement::EMAIL_REMINDER
147+
);
141148
}
142149

143150
/**
@@ -150,10 +157,12 @@ public function testPasswordResetProtectionTypeByIpAndEmail(): void
150157
public function testPasswordResetProtectionTypeByIp(): void
151158
{
152159
$this->markTestSkipped('Test blocked by issue MC-32988.');
153-
$email = '[email protected]';
154160
$this->prepareServerParameters();
155161
$this->expectExceptionObject(new SecurityViolationException($this->errorMessage));
156-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER);
162+
$this->accountManagement->initiatePasswordReset(
163+
164+
CustomerAccountManagement::EMAIL_REMINDER
165+
);
157166
}
158167

159168
/**
@@ -165,10 +174,12 @@ public function testPasswordResetProtectionTypeByIp(): void
165174
*/
166175
public function testPasswordResetProtectionTypeByEmail(): void
167176
{
168-
$email = '[email protected]';
169177
$this->prepareServerParameters();
170178
$this->expectExceptionObject(new SecurityViolationException($this->errorMessage));
171-
$this->accountManagement->initiatePasswordReset($email, CustomerAccountManagement::EMAIL_REMINDER);
179+
$this->accountManagement->initiatePasswordReset(
180+
181+
CustomerAccountManagement::EMAIL_REMINDER
182+
);
172183
}
173184

174185
/**

0 commit comments

Comments
 (0)