-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make more clear that dummy mail is a transactional mail
- Loading branch information
1 parent
cb5d266
commit e62ddc7
Showing
2 changed files
with
11 additions
and
11 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
namespace Duijker\LaravelTransactionalMails\Tests\Unit; | ||
|
||
use Duijker\LaravelTransactionalMails\Tests\Support\DummyMail; | ||
use Duijker\LaravelTransactionalMails\Tests\Support\DummyTransactionalMail; | ||
use Duijker\LaravelTransactionalMails\Tests\TestCase; | ||
use Illuminate\Mail\SendQueuedMailable; | ||
use Illuminate\Mail\Transport\ArrayTransport; | ||
|
@@ -25,7 +25,7 @@ protected function setUp(): void | |
public function it_sends_mail_after_db_commit() | ||
{ | ||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->send(new DummyMail()); | ||
Mail::to('[email protected]')->send(new DummyTransactionalMail()); | ||
$this->assertCount(0, $this->mailDriver->messages()); | ||
DB::commit(); | ||
|
||
|
@@ -38,7 +38,7 @@ public function it_queues_mail_after_db_commit() | |
Queue::fake(); | ||
|
||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->queue(new DummyMail()); | ||
Mail::to('[email protected]')->queue(new DummyTransactionalMail()); | ||
Queue::assertNothingPushed(); | ||
DB::commit(); | ||
|
||
|
@@ -51,7 +51,7 @@ public function it_sends_mail_later_after_db_commit() | |
Queue::fake(); | ||
|
||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->later(now()->addMinutes(10), new DummyMail()); | ||
Mail::to('[email protected]')->later(now()->addMinutes(10), new DummyTransactionalMail()); | ||
Queue::assertNothingPushed(); | ||
DB::commit(); | ||
|
||
|
@@ -62,7 +62,7 @@ public function it_sends_mail_later_after_db_commit() | |
public function it_does_not_sends_mail_after_db_rollback() | ||
{ | ||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->send(new DummyMail()); | ||
Mail::to('[email protected]')->send(new DummyTransactionalMail()); | ||
$this->assertCount(0, $this->mailDriver->messages()); | ||
DB::rollBack(); | ||
|
||
|
@@ -75,7 +75,7 @@ public function it_does_not_queue_mail_after_db_rollback() | |
Queue::fake(); | ||
|
||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->queue(new DummyMail()); | ||
Mail::to('[email protected]')->queue(new DummyTransactionalMail()); | ||
Queue::assertNothingPushed(); | ||
DB::rollBack(); | ||
|
||
|
@@ -88,7 +88,7 @@ public function it_does_not_send_mail_later_after_db_rollback() | |
Queue::fake(); | ||
|
||
DB::beginTransaction(); | ||
Mail::to('[email protected]')->later(now()->addMinutes(10), new DummyMail()); | ||
Mail::to('[email protected]')->later(now()->addMinutes(10), new DummyTransactionalMail()); | ||
Queue::assertNothingPushed(); | ||
DB::rollBack(); | ||
|
||
|
@@ -101,7 +101,7 @@ public function it_sends_mail_when_outer_transaction_is_committed() | |
DB::beginTransaction(); | ||
DB::beginTransaction(); | ||
|
||
Mail::to('[email protected]')->send(new DummyMail()); | ||
Mail::to('[email protected]')->send(new DummyTransactionalMail()); | ||
$this->assertCount(0, $this->mailDriver->messages()); | ||
|
||
DB::commit(); | ||
|
@@ -114,7 +114,7 @@ public function it_sends_mail_when_outer_transaction_is_committed() | |
|
||
public function it_directly_sends_mail_when_after_transactions_property_is_false() | ||
{ | ||
$mail = new DummyMail(); | ||
$mail = new DummyTransactionalMail(); | ||
$mail->afterTransactions = false; | ||
|
||
DB::beginTransaction(); | ||
|
@@ -126,7 +126,7 @@ public function it_directly_sends_mail_when_after_transactions_property_is_false | |
/** @test */ | ||
public function it_directly_sends_mail_when_not_in_transaction() | ||
{ | ||
Mail::to('[email protected]')->send(new DummyMail()); | ||
Mail::to('[email protected]')->send(new DummyTransactionalMail()); | ||
|
||
$this->assertCount(1, $this->mailDriver->messages()); | ||
} | ||
|