Skip to content

Commit 602100b

Browse files
committed
Fix for code standards
1 parent fe7611f commit 602100b

File tree

1 file changed

+57
-24
lines changed

1 file changed

+57
-24
lines changed

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

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,39 @@
2727
*/
2828
class EmailNotificationTest extends TestCase
2929
{
30+
/**
31+
* @var int
32+
*/
3033
private const STUB_CUSTOMER_ID = 1;
3134

35+
/**
36+
* @var int
37+
*/
3238
private const STUB_CUSTOMER_STORE_ID = 2;
3339

40+
/**
41+
* @var int
42+
*/
3443
private const STUB_CUSTOMER_WEBSITE_ID = 1;
3544

45+
/**
46+
* @var string
47+
*/
3648
private const STUB_CUSTOMER_EMAIL = '[email protected]';
3749

50+
/**
51+
* @var string
52+
*/
3853
private const STUB_CUSTOMER_NAME = 'Customer Name';
3954

55+
/**
56+
* @var string
57+
*/
4058
private const STUB_EMAIL_IDENTIFIER = 'Template Identifier';
4159

60+
/**
61+
* @var string
62+
*/
4263
private const STUB_SENDER = 'Sender';
4364

4465
/**
@@ -145,10 +166,10 @@ public function setUp(): void
145166
/**
146167
* Test email notify when credentials changed
147168
*
148-
* @param int $testNumber
169+
* @param int $testNumber
149170
* @param string $oldEmail
150171
* @param string $newEmail
151-
* @param bool $isPasswordChanged
172+
* @param bool $isPasswordChanged
152173
*
153174
* @dataProvider sendNotificationEmailsDataProvider
154175
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
@@ -161,18 +182,18 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
161182
$expects = $this->once();
162183
$xmlPathTemplate = EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE;
163184
switch ($testNumber) {
164-
case 1:
165-
$xmlPathTemplate = EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE;
166-
$expects = $this->once();
167-
break;
168-
case 2:
169-
$xmlPathTemplate = EmailNotification::XML_PATH_CHANGE_EMAIL_TEMPLATE;
170-
$expects = $this->exactly(2);
171-
break;
172-
case 3:
173-
$xmlPathTemplate = EmailNotification::XML_PATH_CHANGE_EMAIL_AND_PASSWORD_TEMPLATE;
174-
$expects = $this->exactly(2);
175-
break;
185+
case 1:
186+
$xmlPathTemplate = EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE;
187+
$expects = $this->once();
188+
break;
189+
case 2:
190+
$xmlPathTemplate = EmailNotification::XML_PATH_CHANGE_EMAIL_TEMPLATE;
191+
$expects = $this->exactly(2);
192+
break;
193+
case 3:
194+
$xmlPathTemplate = EmailNotification::XML_PATH_CHANGE_EMAIL_AND_PASSWORD_TEMPLATE;
195+
$expects = $this->exactly(2);
196+
break;
176197
}
177198

178199
$this->senderResolverMock
@@ -181,7 +202,9 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
181202
->with(self::STUB_SENDER, self::STUB_CUSTOMER_STORE_ID)
182203
->willReturn($senderValues);
183204

184-
/** @var MockObject $origCustomer */
205+
/**
206+
* @var MockObject $origCustomer
207+
*/
185208
$origCustomer = $this->createMock(CustomerInterface::class);
186209
$origCustomer->expects($this->any())
187210
->method('getStoreId')
@@ -237,7 +260,9 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
237260
->with('name', self::STUB_CUSTOMER_NAME)
238261
->willReturnSelf();
239262

240-
/** @var CustomerInterface|MockObject $savedCustomer */
263+
/**
264+
* @var CustomerInterface|MockObject $savedCustomer
265+
*/
241266
$savedCustomer = clone $origCustomer;
242267

243268
$origCustomer->expects($this->any())
@@ -315,7 +340,7 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
315340
/**
316341
* Provides Emails Data Provider
317342
*
318-
* @param void
343+
* @param void
319344
* @return array
320345
*/
321346
public function sendNotificationEmailsDataProvider(): array
@@ -359,7 +384,9 @@ public function testPasswordReminder(): void
359384
->with(self::STUB_SENDER, self::STUB_CUSTOMER_STORE_ID)
360385
->willReturn($senderValues);
361386

362-
/** @var CustomerInterface|MockObject $customer */
387+
/**
388+
* @var CustomerInterface|MockObject $customer
389+
*/
363390
$customer = $this->createMock(CustomerInterface::class);
364391
$customer->expects($this->any())
365392
->method('getWebsiteId')
@@ -460,7 +487,9 @@ public function testPasswordReminderCustomerWithoutStoreId(): void
460487
->method('resolve')
461488
->with(self::STUB_SENDER, $defaultStoreId)
462489
->willReturn($senderValues);
463-
/** @var CustomerInterface|MockObject $customer */
490+
/**
491+
* @var CustomerInterface|MockObject $customer
492+
*/
464493
$customer = $this->createMock(CustomerInterface::class);
465494
$customer->expects($this->any())
466495
->method('getWebsiteId')
@@ -554,7 +583,9 @@ public function testPasswordResetConfirmation(): void
554583
->with(self::STUB_SENDER, self::STUB_CUSTOMER_STORE_ID)
555584
->willReturn($senderValues);
556585

557-
/** @var CustomerInterface|MockObject $customer */
586+
/**
587+
* @var CustomerInterface|MockObject $customer
588+
*/
558589
$customer = $this->createMock(CustomerInterface::class);
559590
$customer->expects($this->once())
560591
->method('getStoreId')
@@ -642,7 +673,9 @@ public function testNewAccount(): void
642673
->with(self::STUB_SENDER, self::STUB_CUSTOMER_STORE_ID)
643674
->willReturn($senderValues);
644675

645-
/** @var CustomerInterface|MockObject $customer */
676+
/**
677+
* @var CustomerInterface|MockObject $customer
678+
*/
646679
$customer = $this->createMock(CustomerInterface::class);
647680
$customer->expects($this->any())
648681
->method('getStoreId')
@@ -723,11 +756,11 @@ public function testNewAccount(): void
723756
* Create default mock for $this->transportBuilderMock.
724757
*
725758
* @param string $templateIdentifier
726-
* @param int $customerStoreId
727-
* @param array $senderValues
759+
* @param int $customerStoreId
760+
* @param array $senderValues
728761
* @param string $customerEmail
729762
* @param string $customerName
730-
* @param array $templateVars
763+
* @param array $templateVars
731764
*
732765
* @return void
733766
*/

0 commit comments

Comments
 (0)