@@ -315,11 +315,13 @@ public function testWithConfirmCreatePostAction()
315
315
$ this ->dispatch ('customer/account/createPost ' );
316
316
$ this ->assertRedirect ($ this ->stringContains ('customer/account/index/ ' ));
317
317
$ this ->assertSessionMessages (
318
- $ this ->equalTo ([
319
- 'You must confirm your account. Please check your email for the confirmation link or '
318
+ $ this ->equalTo (
319
+ [
320
+ 'You must confirm your account. Please check your email for the confirmation link or '
320
321
. '<a href="http://localhost/index.php/customer/account/confirmation/ '
321
322
. '?email=test2%40email.com">click here</a> for a new link. '
322
- ]),
323
+ ]
324
+ ),
323
325
MessageInterface::TYPE_SUCCESS
324
326
);
325
327
}
@@ -333,10 +335,14 @@ public function testExistingEmailCreatePostAction()
333
335
$ this ->dispatch ('customer/account/createPost ' );
334
336
$ this ->assertRedirect ($ this ->stringContains ('customer/account/create/ ' ));
335
337
$ this ->assertSessionMessages (
336
- $ this ->equalTo (['There is already an account with this email address. ' .
337
- 'If you are sure that it is your email address, ' .
338
- '<a href="http://localhost/index.php/customer/account/forgotpassword/">click here</a> ' .
339
- ' to get your password and access your account. ' , ]),
338
+ $ this ->equalTo (
339
+ [
340
+ 'There is already an account with this email address. ' .
341
+ 'If you are sure that it is your email address, ' .
342
+ '<a href="http://localhost/index.php/customer/account/forgotpassword/">click here</a> ' .
343
+ ' to get your password and access your account. ' ,
344
+ ]
345
+ ),
340
346
MessageInterface::TYPE_ERROR
341
347
);
342
348
}
@@ -348,7 +354,11 @@ public function testInactiveUserConfirmationAction()
348
354
{
349
355
$ this ->getRequest ()
350
356
->setMethod ('POST ' )
351
- ->setPostValue (['email ' => 'customer@needAconfirmation.com ' ]);
357
+ ->setPostValue (
358
+ [
359
+ 'email ' => 'customer@needAconfirmation.com ' ,
360
+ ]
361
+ );
352
362
353
363
$ this ->dispatch ('customer/account/confirmation ' );
354
364
$ this ->assertRedirect ($ this ->stringContains ('customer/account/index ' ));
@@ -365,14 +375,20 @@ public function testActiveUserConfirmationAction()
365
375
{
366
376
$ this ->getRequest ()
367
377
->setMethod ('POST ' )
368
- ->setPostValue ([
369
- 'email ' => 'customer@example.com ' ,
370
- ]);
378
+ ->setPostValue (
379
+ [
380
+ 'email ' => 'customer@example.com ' ,
381
+ ]
382
+ );
371
383
372
384
$ this ->dispatch ('customer/account/confirmation ' );
373
385
$ this ->assertRedirect ($ this ->stringContains ('customer/account/index ' ));
374
386
$ this ->assertSessionMessages (
375
- $ this ->equalTo (['This email does not require confirmation. ' ]),
387
+ $ this ->equalTo (
388
+ [
389
+ 'This email does not require confirmation. ' ,
390
+ ]
391
+ ),
376
392
MessageInterface::TYPE_SUCCESS
377
393
);
378
394
}
@@ -413,9 +429,11 @@ public function testForgotPasswordPostWithBadEmailAction()
413
429
{
414
430
$ this ->getRequest ()->setMethod (HttpRequest::METHOD_POST );
415
431
$ this ->getRequest ()
416
- ->setPostValue ([
417
- 'email ' => 'bad@email ' ,
418
- ]);
432
+ ->setPostValue (
433
+ [
434
+ 'email ' => 'bad@email ' ,
435
+ ]
436
+ );
419
437
420
438
$ this ->dispatch ('customer/account/forgotPasswordPost ' );
421
439
$ this ->assertRedirect ($ this ->stringContains ('customer/account/forgotpassword ' ));
@@ -434,10 +452,12 @@ public function testResetPasswordPostNoTokenAction()
434
452
->setParam ('id ' , 1 )
435
453
->setParam ('token ' , '8ed8677e6c79e68b94e61658bd756ea5 ' )
436
454
->setMethod ('POST ' )
437
- ->setPostValue ([
438
- 'password ' => 'new-password ' ,
439
- 'password_confirmation ' => 'new-password ' ,
440
- ]);
455
+ ->setPostValue (
456
+ [
457
+ 'password ' => 'new-password ' ,
458
+ 'password_confirmation ' => 'new-password ' ,
459
+ ]
460
+ );
441
461
442
462
$ this ->dispatch ('customer/account/resetPasswordPost ' );
443
463
$ this ->assertRedirect ($ this ->stringContains ('customer/account/ ' ));
@@ -457,10 +477,12 @@ public function testResetPasswordPostAction()
457
477
->setQueryValue ('id ' , 1 )
458
478
->setQueryValue ('token ' , '8ed8677e6c79e68b94e61658bd756ea5 ' )
459
479
->setMethod ('POST ' )
460
- ->setPostValue ([
461
- 'password ' => 'new-Password1 ' ,
462
- 'password_confirmation ' => 'new-Password1 ' ,
463
- ]);
480
+ ->setPostValue (
481
+ [
482
+ 'password ' => 'new-Password1 ' ,
483
+ 'password_confirmation ' => 'new-Password1 ' ,
484
+ ]
485
+ );
464
486
465
487
$ this ->dispatch ('customer/account/resetPasswordPost ' );
466
488
$ this ->assertRedirect ($ this ->stringContains ('customer/account/login ' ));
@@ -483,8 +505,11 @@ public function testEditAction()
483
505
$ this ->assertEquals (200 , $ this ->getResponse ()->getHttpResponseCode (), $ body );
484
506
$ this ->assertContains ('<div class="field field-name-firstname required"> ' , $ body );
485
507
// Verify the password check box is not checked
486
- $ this ->assertContains ('<input type="checkbox" name="change_password" id="change-password" '
487
- . 'data-role="change-password" value="1" title="Change Password" class="checkbox" /> ' , $ body );
508
+ $ this ->assertContains (
509
+ '<input type="checkbox" name="change_password" id="change-password" '
510
+ . 'data-role="change-password" value="1" title="Change Password" class="checkbox" /> ' ,
511
+ $ body
512
+ );
488
513
}
489
514
490
515
/**
@@ -528,14 +553,16 @@ public function testEditPostAction()
528
553
$ this ->login (1 );
529
554
$ this ->getRequest ()
530
555
->setMethod ('POST ' )
531
- ->setPostValue ([
532
- 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
533
- 'firstname ' => 'John ' ,
534
- 'lastname ' => 'Doe ' ,
535
- 'email ' => 'johndoe@email.com ' ,
536
- 'change_email ' => 1 ,
537
- 'current_password ' => 'password '
538
- ]);
556
+ ->setPostValue (
557
+ [
558
+ 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
559
+ 'firstname ' => 'John ' ,
560
+ 'lastname ' => 'Doe ' ,
561
+ 'email ' => 'johndoe@email.com ' ,
562
+ 'change_email ' => 1 ,
563
+ 'current_password ' => 'password '
564
+ ]
565
+ );
539
566
540
567
$ this ->dispatch ('customer/account/editPost ' );
541
568
@@ -666,16 +693,18 @@ public function testWrongConfirmationEditPostAction()
666
693
$ this ->login (1 );
667
694
$ this ->getRequest ()
668
695
->setMethod ('POST ' )
669
- ->setPostValue ([
670
- 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
671
- 'firstname ' => 'John ' ,
672
- 'lastname ' => 'Doe ' ,
673
- 'email ' => 'johndoe@email.com ' ,
674
- 'change_password ' => 1 ,
675
- 'current_password ' => 'password ' ,
676
- 'password ' => 'new-password ' ,
677
- 'password_confirmation ' => 'new-password-no-match ' ,
678
- ]);
696
+ ->setPostValue (
697
+ [
698
+ 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
699
+ 'firstname ' => 'John ' ,
700
+ 'lastname ' => 'Doe ' ,
701
+ 'email ' => 'johndoe@email.com ' ,
702
+ 'change_password ' => 1 ,
703
+ 'current_password ' => 'password ' ,
704
+ 'password ' => 'new-password ' ,
705
+ 'password_confirmation ' => 'new-password-no-match ' ,
706
+ ]
707
+ );
679
708
680
709
$ this ->dispatch ('customer/account/editPost ' );
681
710
@@ -859,13 +888,15 @@ private function getCustomerByEmail($email)
859
888
*/
860
889
private function prepareRequest ()
861
890
{
862
- $ post = new Parameters ([
863
- 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
864
- 'login ' => [
865
- 'username ' => 'customer@example.com ' ,
866
- 'password ' => 'password '
891
+ $ post = new Parameters (
892
+ [
893
+ 'form_key ' => $ this ->_objectManager ->get (FormKey::class)->getFormKey (),
894
+ 'login ' => [
895
+ 'username ' => 'customer@example.com ' ,
896
+ 'password ' => 'password '
897
+ ]
867
898
]
868
- ] );
899
+ );
869
900
$ request = $ this ->getRequest ();
870
901
$ formKey = $ this ->_objectManager ->get (FormKey::class);
871
902
$ request ->setParam ('form_key ' , $ formKey ->getFormKey ());
0 commit comments