本文整理汇总了PHP中Illuminate\Support\Facades\Mail::shouldReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::shouldReceive方法的具体用法?PHP Mail::shouldReceive怎么用?PHP Mail::shouldReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Mail
的用法示例。
在下文中一共展示了Mail::shouldReceive方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSend
public function testSend()
{
$user = m::mock();
$user->shouldReceive('getResetPasswordCode')->once()->andReturn('123456789');
Mail::shouldReceive('queue')->once()->with(m::type('array'), array('user' => $user, 'code' => '123456789'), m::type('closure'));
$this->reset->send($user);
}
示例2: testSend
public function testSend()
{
$user = m::mock();
$user->shouldReceive('getActivationCode')->once()->andReturn('secretC0d3');
Mail::shouldReceive('queue')->once()->with(m::type('array'), array('user' => $user, 'code' => 'secretC0d3'), m::type('closure'));
$this->activation->send($user);
}
示例3: it_registers_MailRecorder_withMail_in_the_setup_with_before_annotated_method
/**
* @test
* @group unit
*/
public function it_registers_MailRecorder_withMail_in_the_setup_with_before_annotated_method()
{
$swift_mock = Mockery::mock(Swift_Mailer::class);
$swift_mock->shouldReceive('registerPlugin')->once()->with(Mockery::on(function ($closure) {
return is_a($closure, MailRecorder::class);
}))->andReturnNull();
Mail::shouldReceive('getSwiftMailer')->once()->withNoArgs()->andReturn($swift_mock);
// TODO: Get this method name by parsing annotations
$this->mail_tracking->setUpMailTracking();
}
示例4: testSendEmailInvite
public function testSendEmailInvite()
{
\Illuminate\Support\Facades\Request::setSession($this->app['session.store']);
$user = User::findOrFail(1);
Mail::shouldReceive('send')->once()->andReturn(function ($message) {
$this->assertEquals('fleetany invitation', $message->getSubject());
$this->assertEquals($user->email, $message->getTo());
$this->assertEquals(View::make('emails.invite'), $message->getBody());
});
try {
$repo = new UserRepositoryEloquent(new Application());
$userController = new InviteController($repo);
$userController->sendEmailInvite($user->id);
} catch (\Exception $e) {
echo $e->getMessage();
}
}
示例5: testSendEmailNotification
public function testSendEmailNotification()
{
Mail::shouldReceive('queue')->once();
$email = new \Skovachev\Notifier\Notifiers\EmailNotifier();
Config::shouldReceive('get')->once()->with('notifier::email.enabled')->andReturn(true);
Config::shouldReceive('get')->once()->with('notifier::views_folder')->andReturn('viewsFolder');
Config::shouldReceive('get')->once()->with('notifier::email.from_email')->andReturn('fromEmail');
Config::shouldReceive('get')->once()->with('notifier::email.cc_email')->andReturn('ccEmail');
Config::shouldReceive('get')->once()->with('notifier::email.bcc_email')->andReturn('bccEmail');
Config::shouldReceive('get')->once()->with('notifier::email.getter_email')->andReturn(function ($user) {
return 'getterEmail';
});
Config::shouldReceive('get')->once()->with('notifier::email.getter_name')->andReturn(function ($user) {
return 'userName';
});
$email->notify('fooUser', 'fooView', array('foo' => 'bar'));
}