示例#1
0
 public function testHostname()
 {
     $this->assertEquals('smtp.sendgrid.net', SendGrid\Smtp::HOSTNAME);
     $sendgrid = new SendGrid("foo", "bar");
     //we can't check that the port works, but we can check that it doesn't throw an exception
     $object = $sendgrid->smtp->setPort(SendGrid\Smtp::HOSTNAME);
     $this->assertEquals($sendgrid->smtp, $object);
     $this->assertEquals(get_class($object), 'SendGrid\\Smtp');
     $mock = new SmtpMock('foo', 'bar');
     $mock->setHostname('smtp.dude.com');
     $this->assertEquals('smtp.dude.com', $mock->getHostname());
 }
示例#2
0
 public function testPorts()
 {
     $this->assertEquals(587, SendGrid\Smtp::TLS);
     $this->assertEquals(25, SendGrid\Smtp::TLS_ALTERNATIVE);
     $this->assertEquals(465, SendGrid\Smtp::SSL);
     $sendgrid = new SendGrid("foo", "bar");
     //we can't check that the port works, but we can check that it doesn't throw an exception
     $object = $sendgrid->smtp->setPort(SendGrid\Smtp::TLS);
     $this->assertEquals($sendgrid->smtp, $object);
     $this->assertEquals(get_class($object), 'SendGrid\\Smtp');
     $mock = new SmtpMock('foo', 'bar');
     $mock->setPort('52');
     $this->assertEquals('52', $mock->getPort());
 }