Source of file Web.php
Size: 2,231 Bytes - Last Modified: 2021-12-23T10:53:20+00:00
/var/www/docs.ssmods.com/process/src/test/SendGrid/Web.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | <?php class SendGridTest_Web extends PHPUnit_Framework_TestCase { public function testConstruction() { $sendgrid = new SendGrid("foo", "bar"); $web = $sendgrid->web; $this->assertEquals(new SendGrid\Web("foo", "bar"), $web); $this->assertEquals(get_class($web), "SendGrid\Web"); } public function testSendResponse() { $sendgrid = new SendGrid("foo", "bar"); $email = new SendGrid\Email(); $email->setFrom('bar@foo.com')-> setSubject('foobar subject')-> setText('foobar text')-> addTo('foo@bar.com'); $response = $sendgrid->web->send($email); $this->assertEquals("Bad username / password", $response->errors[0]); } public function testSendResponseWithAttachment() { $sendgrid = new SendGrid("foo", "bar"); $email = new SendGrid\Email(); $email->setFrom('p1@mailinator.com')-> setSubject('foobar subject')-> setText('foobar text')-> addTo('p1@mailinator.com')-> addAttachment('./gif.gif'); $response = $sendgrid->web->send($email); $this->assertEquals("Bad username / password", $response->errors[0]); } public function testSendResponseWithAttachmentMissingExtension() { $sendgrid = new SendGrid("foo", "bar"); $email = new SendGrid\Email(); $email->setFrom('p1@mailinator.com')-> setSubject('foobar subject')-> setText('foobar text')-> addTo('p1@mailinator.com')-> addAttachment('./text'); $response = $sendgrid->web->send($email); $this->assertEquals("Bad username / password", $response->errors[0]); } public function testSendResponseWithSslOptionFalse() { $sendgrid = new SendGrid("foo", "bar", array("switch_off_ssl_verification" => true)); $email = new SendGrid\Email(); $email->setFrom('p1@mailinator.com')-> setSubject('foobar subject')-> setText('foobar text')-> addTo('p1@mailinator.com')-> addAttachment('./text'); $response = $sendgrid->web->send($email); $this->assertEquals("Bad username / password", $response->errors[0]); } } |