Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit c4d285d

Browse files
committed
Merge branch 'develop'
2 parents 0f257ee + c07b936 commit c4d285d

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
phpunit.xml
44
/build
55
composer.lock
6+
.idea/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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",

src/MailTracking.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

tests/Stubs/MailTrackingStub.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)