当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail::shouldReceive方法代码示例

本文整理汇总了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);
 }
开发者ID:djordje,项目名称:laravel-sentry-backend,代码行数:7,代码来源:ServicesNotifiersPasswordResetTest.php

示例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);
 }
开发者ID:djordje,项目名称:laravel-sentry-backend,代码行数:7,代码来源:ServicesNotifiersAccountActivationTest.php

示例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();
 }
开发者ID:spinen,项目名称:laravel-mail-assertions,代码行数:14,代码来源:MailTrackingTest.php

示例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();
     }
 }
开发者ID:alientronics,项目名称:fleetany-web,代码行数:17,代码来源:UserModelTest.php

示例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'));
 }
开发者ID:skovachev,项目名称:notifier,代码行数:17,代码来源:EmailNotifierTest.php


注:本文中的Illuminate\Support\Facades\Mail::shouldReceive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。