This repository was archived by the owner on Apr 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 66use Mockery ;
77use ReflectionClass ;
88use Spinen \MailAssertions \Stubs \MailTrackingStub as MailTracking ;
9+ use Spinen \MailAssertions \Stubs \OldMailTrackingStub as OldMailTracking ;
910use Swift_Mailer ;
1011use Swift_Message ;
1112
@@ -115,6 +116,33 @@ public function it_registers_MailRecorder_withMail_in_the_setup_with_before_anno
115116 $ this ->mail_tracking ->setUpMailTracking ();
116117 }
117118
119+ /**
120+ * @test
121+ * @group unit
122+ */
123+ public function it_registers_MailRecorder_without_afterApplicationCreated_method_present ()
124+ {
125+ // Use a version of the MailTrackingStub without the afterApplicationCreated method
126+ $ this ->mail_tracking = new OldMailTracking ();
127+
128+ $ swift_mock = Mockery::mock (Swift_Mailer::class);
129+
130+ $ swift_mock ->shouldReceive ('registerPlugin ' )
131+ ->once ()
132+ ->with (Mockery::on (function ($ closure ) {
133+ return is_a ($ closure , MailRecorder::class);
134+ }))
135+ ->andReturnNull ();
136+
137+ Mail::shouldReceive ('getSwiftMailer ' )
138+ ->once ()
139+ ->withNoArgs ()
140+ ->andReturn ($ swift_mock );
141+
142+ // TODO: Get this method name by parsing annotations
143+ $ this ->mail_tracking ->setUpMailTracking ();
144+ }
145+
118146 /**
119147 * @test
120148 * @group unit
You can’t perform that action at this time.
0 commit comments