@@ -10,54 +10,30 @@ final class MailerCest
1010{
1111 public function dontSeeEmailIsSent (FunctionalTester $ I )
1212 {
13- $ I ->amOnPage ('/register ' );
14- $ I ->stopFollowingRedirects ();
15- $ I ->submitSymfonyForm ('registration_form ' , [
16- 17- '[password] ' => '123456 ' ,
18- '[agreeTerms] ' => true ,
19- ]);
13+ $ I->
registerUser (
'[email protected] ' ,
'123456 ' , followRedirects:
false );
2014 // There is already an account with this email
2115 $ I ->dontSeeEmailIsSent ();
2216 }
2317
2418 public function grabLastSentEmail (FunctionalTester $ I )
2519 {
26- $ I ->amOnPage ('/register ' );
27- $ I ->stopFollowingRedirects ();
28- $ I ->submitSymfonyForm ('registration_form ' , [
29- 30- '[password] ' => '123456 ' ,
31- '[agreeTerms] ' => true ,
32- ]);
20+ $ I->
registerUser (
'[email protected] ' ,
'123456 ' , followRedirects:
false );
3321 $ email = $ I ->grabLastSentEmail ();
3422 $ address = $ email ->getTo ()[0 ];
3523 $ I->
assertSame (
'[email protected] ' ,
$ address->
getAddress ());
3624 }
3725
3826 public function grabSentEmails (FunctionalTester $ I )
3927 {
40- $ I ->amOnPage ('/register ' );
41- $ I ->stopFollowingRedirects ();
42- $ I ->submitSymfonyForm ('registration_form ' , [
43- 44- '[password] ' => '123456 ' ,
45- '[agreeTerms] ' => true ,
46- ]);
28+ $ I->
registerUser (
'[email protected] ' ,
'123456 ' , followRedirects:
false );
4729 $ emails = $ I ->grabSentEmails ();
4830 $ address = $ emails [0 ]->getTo ()[0 ];
4931 $ I->
assertSame (
'[email protected] ' ,
$ address->
getAddress ());
5032 }
5133
5234 public function seeEmailIsSent (FunctionalTester $ I )
5335 {
54- $ I ->amOnPage ('/register ' );
55- $ I ->stopFollowingRedirects ();
56- $ I ->submitSymfonyForm ('registration_form ' , [
57- 58- '[password] ' => '123456 ' ,
59- '[agreeTerms] ' => true ,
60- ]);
36+ $ I->
registerUser (
'[email protected] ' ,
'123456 ' , followRedirects:
false );
6137 $ I ->seeEmailIsSent ();
6238 }
6339}
0 commit comments