@@ -10,54 +10,30 @@ final class MailerCest
10
10
{
11
11
public function dontSeeEmailIsSent (FunctionalTester $ I )
12
12
{
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 );
20
14
// There is already an account with this email
21
15
$ I ->dontSeeEmailIsSent ();
22
16
}
23
17
24
18
public function grabLastSentEmail (FunctionalTester $ I )
25
19
{
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 );
33
21
$ email = $ I ->grabLastSentEmail ();
34
22
$ address = $ email ->getTo ()[0 ];
35
23
$ I->
assertSame (
'[email protected] ' ,
$ address->
getAddress ());
36
24
}
37
25
38
26
public function grabSentEmails (FunctionalTester $ I )
39
27
{
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 );
47
29
$ emails = $ I ->grabSentEmails ();
48
30
$ address = $ emails [0 ]->getTo ()[0 ];
49
31
$ I->
assertSame (
'[email protected] ' ,
$ address->
getAddress ());
50
32
}
51
33
52
34
public function seeEmailIsSent (FunctionalTester $ I )
53
35
{
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 );
61
37
$ I ->seeEmailIsSent ();
62
38
}
63
39
}
0 commit comments