27
27
*/
28
28
class EmailNotificationTest extends TestCase
29
29
{
30
+ /**
31
+ * @var int
32
+ */
30
33
private const STUB_CUSTOMER_ID = 1 ;
31
34
35
+ /**
36
+ * @var int
37
+ */
32
38
private const STUB_CUSTOMER_STORE_ID = 2 ;
33
39
40
+ /**
41
+ * @var int
42
+ */
34
43
private const STUB_CUSTOMER_WEBSITE_ID = 1 ;
35
44
45
+ /**
46
+ * @var string
47
+ */
36
48
private const STUB_CUSTOMER_EMAIL =
'[email protected] ' ;
37
49
50
+ /**
51
+ * @var string
52
+ */
38
53
private const STUB_CUSTOMER_NAME = 'Customer Name ' ;
39
54
55
+ /**
56
+ * @var string
57
+ */
40
58
private const STUB_EMAIL_IDENTIFIER = 'Template Identifier ' ;
41
59
60
+ /**
61
+ * @var string
62
+ */
42
63
private const STUB_SENDER = 'Sender ' ;
43
64
44
65
/**
@@ -145,10 +166,10 @@ public function setUp(): void
145
166
/**
146
167
* Test email notify when credentials changed
147
168
*
148
- * @param int $testNumber
169
+ * @param int $testNumber
149
170
* @param string $oldEmail
150
171
* @param string $newEmail
151
- * @param bool $isPasswordChanged
172
+ * @param bool $isPasswordChanged
152
173
*
153
174
* @dataProvider sendNotificationEmailsDataProvider
154
175
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
@@ -161,18 +182,18 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
161
182
$ expects = $ this ->once ();
162
183
$ xmlPathTemplate = EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE ;
163
184
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 ;
176
197
}
177
198
178
199
$ this ->senderResolverMock
@@ -181,7 +202,9 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
181
202
->with (self ::STUB_SENDER , self ::STUB_CUSTOMER_STORE_ID )
182
203
->willReturn ($ senderValues );
183
204
184
- /** @var MockObject $origCustomer */
205
+ /**
206
+ * @var MockObject $origCustomer
207
+ */
185
208
$ origCustomer = $ this ->createMock (CustomerInterface::class);
186
209
$ origCustomer ->expects ($ this ->any ())
187
210
->method ('getStoreId ' )
@@ -237,7 +260,9 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
237
260
->with ('name ' , self ::STUB_CUSTOMER_NAME )
238
261
->willReturnSelf ();
239
262
240
- /** @var CustomerInterface|MockObject $savedCustomer */
263
+ /**
264
+ * @var CustomerInterface|MockObject $savedCustomer
265
+ */
241
266
$ savedCustomer = clone $ origCustomer ;
242
267
243
268
$ origCustomer ->expects ($ this ->any ())
@@ -315,7 +340,7 @@ public function testEmailNotifyWhenCredentialsChanged($testNumber, $oldEmail, $n
315
340
/**
316
341
* Provides Emails Data Provider
317
342
*
318
- * @param void
343
+ * @param void
319
344
* @return array
320
345
*/
321
346
public function sendNotificationEmailsDataProvider (): array
@@ -359,7 +384,9 @@ public function testPasswordReminder(): void
359
384
->with (self ::STUB_SENDER , self ::STUB_CUSTOMER_STORE_ID )
360
385
->willReturn ($ senderValues );
361
386
362
- /** @var CustomerInterface|MockObject $customer */
387
+ /**
388
+ * @var CustomerInterface|MockObject $customer
389
+ */
363
390
$ customer = $ this ->createMock (CustomerInterface::class);
364
391
$ customer ->expects ($ this ->any ())
365
392
->method ('getWebsiteId ' )
@@ -460,7 +487,9 @@ public function testPasswordReminderCustomerWithoutStoreId(): void
460
487
->method ('resolve ' )
461
488
->with (self ::STUB_SENDER , $ defaultStoreId )
462
489
->willReturn ($ senderValues );
463
- /** @var CustomerInterface|MockObject $customer */
490
+ /**
491
+ * @var CustomerInterface|MockObject $customer
492
+ */
464
493
$ customer = $ this ->createMock (CustomerInterface::class);
465
494
$ customer ->expects ($ this ->any ())
466
495
->method ('getWebsiteId ' )
@@ -554,7 +583,9 @@ public function testPasswordResetConfirmation(): void
554
583
->with (self ::STUB_SENDER , self ::STUB_CUSTOMER_STORE_ID )
555
584
->willReturn ($ senderValues );
556
585
557
- /** @var CustomerInterface|MockObject $customer */
586
+ /**
587
+ * @var CustomerInterface|MockObject $customer
588
+ */
558
589
$ customer = $ this ->createMock (CustomerInterface::class);
559
590
$ customer ->expects ($ this ->once ())
560
591
->method ('getStoreId ' )
@@ -642,7 +673,9 @@ public function testNewAccount(): void
642
673
->with (self ::STUB_SENDER , self ::STUB_CUSTOMER_STORE_ID )
643
674
->willReturn ($ senderValues );
644
675
645
- /** @var CustomerInterface|MockObject $customer */
676
+ /**
677
+ * @var CustomerInterface|MockObject $customer
678
+ */
646
679
$ customer = $ this ->createMock (CustomerInterface::class);
647
680
$ customer ->expects ($ this ->any ())
648
681
->method ('getStoreId ' )
@@ -723,11 +756,11 @@ public function testNewAccount(): void
723
756
* Create default mock for $this->transportBuilderMock.
724
757
*
725
758
* @param string $templateIdentifier
726
- * @param int $customerStoreId
727
- * @param array $senderValues
759
+ * @param int $customerStoreId
760
+ * @param array $senderValues
728
761
* @param string $customerEmail
729
762
* @param string $customerName
730
- * @param array $templateVars
763
+ * @param array $templateVars
731
764
*
732
765
* @return void
733
766
*/
0 commit comments