Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor swiftmailer to symfony mailer #10

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleaning up
  • Loading branch information
AlexzPurewoko committed Jul 17, 2024
commit 6e8af0fae405ebebc91920607e60bdc7c8e0735b
25 changes: 1 addition & 24 deletions tests/Mail/MailMailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ protected function tearDown(): void

public function testMailerSendSendsMessageWithProperViewContent()
{
unset($_SERVER['__mailer.test']);

$view = m::mock(Factory::class);
$view->shouldReceive('make')->once()->andReturn($view);
$view->shouldReceive('render')->once()->andReturn('rendered.view');
Expand Down Expand Up @@ -251,7 +249,7 @@ public function testGlobalFromIsRespectedOnAllMessages()
$view = m::mock(Factory::class);
$view->shouldReceive('make')->once()->andReturn($view);
$view->shouldReceive('render')->once()->andReturn('rendered.view');
$mailer = new Mailer($view, $transport = new ArrayTransport);
$mailer = new Mailer($view, $transport = new ArrayTransport());
$mailer->alwaysFrom('[email protected]');

$mailer->send('foo', ['data'], function (Message $message) {
Expand All @@ -267,25 +265,4 @@ public function testGlobalFromIsRespectedOnAllMessages()
self::assertSame('[email protected]', $sentMessage->getEnvelope()->getRecipients()[0]->getAddress());
self::assertSame('[email protected]', $sentMessage->getEnvelope()->getSender()->getAddress());
}


protected function getMailer()
{
return new Illuminate\Mail\Mailer(m::mock(Factory::class), m::mock('Swift_Mailer'));
}


protected function getMocks()
{
return [m::mock(Factory::class), m::mock('Swift_Mailer')];
}

}

class FailingSwiftMailerStub
{
public function send($message, &$failed)
{
$failed[] = '[email protected]';
}
}
Loading