-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e17030
commit 9a14de8
Showing
2 changed files
with
28 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,22 +6,11 @@ | |
use Illuminate\Support\Facades\View; | ||
use IWasHereFirst2\LaravelMultiMail\Facades\MultiMail; | ||
use IWasHereFirst2\LaravelMultiMail\Tests\TestCase; | ||
use Swift_Events_EventListener; | ||
use Swift_Message; | ||
|
||
class MultiMailTest extends TestCase | ||
{ | ||
const FROM = '[email protected]'; | ||
|
||
protected $emails; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
MultiMail::registerPlugin(new TestingMailEventListener($this)); | ||
} | ||
|
||
/** @test */ | ||
public function check_if_mail_is_sendable() | ||
{ | ||
|
@@ -62,11 +51,6 @@ protected function getEnvironmentSetUp($app) | |
|
||
View::addLocation(__DIR__ . '/Fixtures'); | ||
} | ||
|
||
public function addEmail(Swift_Message $email) | ||
{ | ||
$this->emails[] = $email; | ||
} | ||
} | ||
|
||
class TestMail extends Mailable | ||
|
@@ -81,18 +65,3 @@ public function build() | |
return $this->view('view'); | ||
} | ||
} | ||
|
||
class TestingMailEventListener implements Swift_Events_EventListener | ||
{ | ||
protected $test; | ||
|
||
public function __construct($test) | ||
{ | ||
$this->test = $test; | ||
} | ||
|
||
public function beforeSendPerformed($event) | ||
{ | ||
$this->test->addEmail($event->getMessage()); | ||
} | ||
} |