3
3
namespace Symfony \Bundle \FrameworkBundle \Tests \Functional ;
4
4
5
5
use Psr \Log \LoggerInterface ;
6
+ use Symfony \Bundle \FullStack ;
6
7
use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
7
8
use Symfony \Component \Mailer \Mailer ;
8
9
use Symfony \Component \Mailer \SentMessage ;
@@ -71,9 +72,19 @@ public function testMailerAssertions()
71
72
$ client ->request ('GET ' , '/send_email ' );
72
73
73
74
$ this ->assertEmailCount (2 );
74
- $ this ->assertEmailIsQueued ($ this ->getMailerEvent (0 ));
75
-
76
- $ email = $ this ->getMailerMessage (0 );
75
+ $ first = 0 ;
76
+ $ second = 1 ;
77
+ if (!class_exists (FullStack::class)) {
78
+ $ this ->assertQueuedEmailCount (2 );
79
+ $ first = 1 ;
80
+ $ second = 3 ;
81
+ $ this ->assertEmailIsQueued ($ this ->getMailerEvent (0 ));
82
+ $ this ->assertEmailIsQueued ($ this ->getMailerEvent (2 ));
83
+ }
84
+ $ this ->assertEmailIsNotQueued ($ this ->getMailerEvent ($ first ));
85
+ $ this ->assertEmailIsNotQueued ($ this ->getMailerEvent ($ second ));
86
+
87
+ $ email = $ this ->getMailerMessage ($ first );
77
88
$ this ->assertEmailHasHeader ($ email , 'To ' );
78
89
$ this ->
assertEmailHeaderSame (
$ email,
'To ' ,
'[email protected] ' );
79
90
$ this ->
assertEmailHeaderNotSame (
$ email,
'To ' ,
'[email protected] ' );
@@ -83,7 +94,7 @@ public function testMailerAssertions()
83
94
$ this ->assertEmailHtmlBodyNotContains ($ email , 'Bar ' );
84
95
$ this ->assertEmailAttachementCount ($ email , 1 );
85
96
86
- $ email = $ this ->getMailerMessage (1 );
97
+ $ email = $ this ->getMailerMessage ($ second );
87
98
$ this ->
assertEmailAddressContains (
$ email,
'To ' ,
'[email protected] ' );
88
99
$ this ->
assertEmailAddressContains (
$ email,
'To ' ,
'[email protected] ' );
89
100
$ this ->
assertEmailAddressContains (
$ email,
'Reply-To ' ,
'[email protected] ' );
0 commit comments