This repository was archived by the owner on Apr 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 33phpunit.xml
44/build
55composer.lock
6+ .idea /
Original file line number Diff line number Diff line change 1818 "require" : {
1919 "php" : " >=5.5.0" ,
2020 "illuminate/support" : " ~5.1.10|5.2.*|5.3.*|5.4.*|5.5.*" ,
21- "swiftmailer/swiftmailer" : " ~5.1"
21+ "swiftmailer/swiftmailer" : " ~5.1|~6.0 "
2222 },
2323 "require-dev" : {
2424 "mockery/mockery" : " ^0.9.1" ,
Original file line number Diff line number Diff line change @@ -48,8 +48,10 @@ trait MailTracking
4848 */
4949 public function setUpMailTracking ()
5050 {
51- Mail::getSwiftMailer ()
52- ->registerPlugin (new MailRecorder ($ this ));
51+ $ this ->afterApplicationCreated (function () {
52+ Mail::getSwiftMailer ()
53+ ->registerPlugin (new MailRecorder ($ this ));
54+ });
5355 }
5456
5557 /**
Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ class MailTrackingStub extends PHPUnit_Framework_TestCase
1414{
1515 use MailTracking;
1616
17+ /**
18+ * Stubs Laravel's afterApplicationCreated() method so that tests can run normally
19+ *
20+ * @param callable $callback
21+ *
22+ * @return void
23+ */
24+ public function afterApplicationCreated (callable $ callback )
25+ {
26+ call_user_func ($ callback );
27+ }
28+
1729 /**
1830 * Public method in the stub to expose the protected email collection
1931 *
You can’t perform that action at this time.
0 commit comments