Permalink
Browse files

added tests for SendGrid main class

  • Loading branch information...
CJ Buchmann
CJ Buchmann committed Feb 14, 2012
1 parent b3e0878 commit cd56f738588cb8345ce88180e8eec598fb3c7653
Showing with 36 additions and 0 deletions.
  1. +36 −0 Test/SendGridTest.php
View
@@ -0,0 +1,36 @@
+<?php
+
+class SendGridTest extends PHPUnit_Framework_TestCase
+{
+
+ public function testConstruction()
+ {
+ $sendgrid = new SendGrid("fake_username", "fake_password");
+
+ $this->assertEquals("SendGrid", get_class($sendgrid));
+ }
+
+ public function testInitializers()
+ {
+ $sendgrid = new SendGrid("fake_username", "fake_password");
+
+ // test the working initializers that we currently have
+ $smtp = $sendgrid->smtp;
+ $web = $sendgrid->web;
+
+ $this->assertEquals("SendGrid\Smtp", get_class($smtp));
+ $this->assertEquals("SendGrid\Web", get_class($web));
+
+ try
+ {
+ $sendgrid->notanapi;
+ }
+ catch (Exception $e)
+ {
+ return;
+ }
+
+ $this->fail('A non object was instanciated');
+
+ }
+}

0 comments on commit cd56f73

Please sign in to comment.