Exemplo n.º 1
0
 public function testSendGridExceptionNotThrownWhen200()
 {
     $mockResponse = new Response(200, '', json_encode(['message' => 'success']));
     $sendgrid = m::mock('Brash\\SendGrid\\Client[postRequest]', ['token1234']);
     $sendgrid->shouldReceive('postRequest')->once()->andReturn($mockResponse);
     $email = new Email();
     $email->setFrom('*****@*****.**')->setSubject('foobar subject')->setText('foobar text')->addTo('*****@*****.**');
     $response = $sendgrid->send($email);
 }
Exemplo n.º 2
0
 public function testToWebFormatWithFilters()
 {
     $email = new Email();
     $email->addFilter("footer", "text/plain", "Here is a plain text footer");
     $json = $email->toWebFormat();
     $xsmtpapi = json_decode($json['x-smtpapi'], TRUE);
     $this->assertEquals('Here is a plain text footer', $xsmtpapi['filters']['footer']['settings']['text/plain']);
 }