當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。