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); }
public function testToWebFormatWithBccName() { $email = new Email(); $email->addBcc('*****@*****.**', 'Frank Foo'); $email->setFrom('*****@*****.**'); $json = $email->toWebFormat(); $this->assertEquals($json['bccname'], array('Frank Foo')); }