Skip to content

Instantly share code, notes, and snippets.

@muhamed-didovic
Forked from JeffreyWay/gist:5348385
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save muhamed-didovic/00e11a5544e95e3d50a3 to your computer and use it in GitHub Desktop.

Select an option

Save muhamed-didovic/00e11a5544e95e3d50a3 to your computer and use it in GitHub Desktop.
<?php
class MyMailer {
public function deliver()
{
// This facade doesn't need to be injected into the class.
Mail::send('emails.welcome', [], function($m)
{
$m->to('jeffrey@foo.com')
->subject('Welcome to the site')
->setCharset('UTF-8');
});
}
}
class ExampleTest extends TestCase {
public function tearDown()
{
Mockery::close();
}
public function testBasicExample()
{
// mock it
Mail::shouldReceive('send')->once();
(new MyMailer)->deliver();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment