12
12
13
13
use Hyperf \Utils \ApplicationContext ;
14
14
use HyperfExt \Mail \Contracts \MailableInterface ;
15
- use HyperfExt \Mail \Events \MessageSending ;
16
- use HyperfExt \Mail \Events \MessageSent ;
15
+ use HyperfExt \Mail \Events \MailMessageSending ;
16
+ use HyperfExt \Mail \Events \MailMessageSent ;
17
17
use HyperfExt \Mail \Mailer ;
18
18
use Mockery as m ;
19
19
use PHPUnit \Framework \TestCase ;
@@ -39,8 +39,8 @@ public function testGlobalFromIsRespectedOnAllMessages()
39
39
$ mailable = m::mock (MailableInterface::class);
40
40
$ mailable ->shouldReceive ('handler ' )->once ()->andReturn (null );
41
41
$ events = ApplicationContext::getContainer ()->get (EventDispatcherInterface::class);
42
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSending ::class));
43
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSent ::class));
42
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSending ::class));
43
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSent ::class));
44
44
$ mailer = $ this ->getMailer ();
45
45
$ this ->setSwiftMailer ($ mailer );
46
46
$ mailer->
setAlwaysFrom (
'[email protected] ' ,
'Taylor Otwell ' );
@@ -56,8 +56,8 @@ public function testGlobalReturnPathIsRespectedOnAllMessages()
56
56
$ mailable = m::mock (MailableInterface::class);
57
57
$ mailable ->shouldReceive ('handler ' )->once ()->andReturn (null );
58
58
$ events = ApplicationContext::getContainer ()->get (EventDispatcherInterface::class);
59
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSending ::class));
60
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSent ::class));
59
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSending ::class));
60
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSent ::class));
61
61
$ mailer = $ this ->getMailer ();
62
62
$ this ->setSwiftMailer ($ mailer );
63
63
$ mailer->
setAlwaysReturnPath (
'[email protected] ' );
@@ -73,8 +73,8 @@ public function testFailedRecipientsAreAppendedAndCanBeRetrieved()
73
73
$ mailable = m::mock (MailableInterface::class);
74
74
$ mailable ->shouldReceive ('handler ' )->once ()->andReturn (null );
75
75
$ events = ApplicationContext::getContainer ()->get (EventDispatcherInterface::class);
76
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSending ::class));
77
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSent ::class));
76
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSending ::class));
77
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSent ::class));
78
78
$ mailer = $ this ->getMailer ();
79
79
$ mailer ->getSwiftMailer ()->shouldReceive ('getTransport ' )->andReturn ($ transport = m::mock (Swift_Transport::class));
80
80
$ transport ->shouldReceive ('stop ' );
@@ -93,8 +93,8 @@ public function testEventsAreDispatched()
93
93
$ mailable = m::mock (MailableInterface::class);
94
94
$ mailable ->shouldReceive ('handler ' )->once ()->andReturn (null );
95
95
$ events = ApplicationContext::getContainer ()->get (EventDispatcherInterface::class);
96
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSending ::class));
97
- $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MessageSent ::class));
96
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSending ::class));
97
+ $ events ->shouldReceive ('dispatch ' )->once ()->with (m::type (MailMessageSent ::class));
98
98
$ mailer = $ this ->getMailer ($ events );
99
99
$ this ->setSwiftMailer ($ mailer );
100
100
$ mailer ->getSwiftMailer ()->shouldReceive ('send ' )->once ()->with (m::type (Swift_Message::class), []);
0 commit comments