예제 #1
0
파일: MailerTest.php 프로젝트: elgg/elgg
 function testElggSendEmailBypass()
 {
     _elgg_services()->hooks->registerHandler('email', 'system', [$this, 'handleEmailHookTrue']);
     $this->assertTrue(elgg_send_email("*****@*****.**", "*****@*****.**", "Hello", "World", ['foo' => 1]));
     _elgg_services()->hooks->unregisterHandler('email', 'system', [$this, 'handleEmailHookTrue']);
     $this->assertNull($this->mailer->getLastMessage());
 }
 /** @test */
 function it_should_send_deposit_received_email()
 {
     $template = Mockery::mock(TemplateEngine::class);
     $template->shouldReceive('render')->once()->with(Mockery::type('string'), Mockery::type('array'));
     $transport = new InMemory();
     $sender = new TransferFundsZendMailSender($template, $transport);
     $sender->sendDepositReceivedEmail(A::member()->build()->information(), A::member()->withEmail('*****@*****.**')->build()->information(), Money::MXN(500), new DateTime());
     $this->assertEquals('*****@*****.**', $transport->getLastMessage()->getTo()->current()->getEmail(), 'Address doesn\'t belong to the member receiving the deposit');
     $this->assertRegExp('/received.*deposit/', $transport->getLastMessage()->getSubject(), 'Email\'s subject is wrong');
 }