Skip to content

Commit

Permalink
🎨 Rename dummy class
Browse files Browse the repository at this point in the history
Make more clear that dummy mail is a transactional mail
  • Loading branch information
mvanduijker committed Jun 21, 2019
1 parent cb5d266 commit e62ddc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Duijker\LaravelTransactionalMails\TransactionalMailable;

class DummyMail extends TransactionalMailable
class DummyTransactionalMail extends TransactionalMailable
{
public function build()
{
Expand Down
20 changes: 10 additions & 10 deletions tests/Unit/TransaciontalMailableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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());
}
Expand Down

0 comments on commit e62ddc7

Please sign in to comment.