summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornornholdj <nornholdj@gmail.com>2014-11-04 15:53:43 -0500
committernornholdj <nornholdj@gmail.com>2014-11-04 15:53:43 -0500
commit1fdabdbdde9cb927fea2c06d2c0eb95e06db1e54 (patch)
treeb7f2886de77c8dacff3ece6ac7bf31e5cc6e5421
parent1d6fad1db52c968f7cb8f6a93d3c84ae1f2b2dd8 (diff)
downloadphp-sparkpost-1fdabdbdde9cb927fea2c06d2c0eb95e06db1e54.zip
php-sparkpost-1fdabdbdde9cb927fea2c06d2c0eb95e06db1e54.tar.gz
php-sparkpost-1fdabdbdde9cb927fea2c06d2c0eb95e06db1e54.tar.bz2
MA-946 #time 20m updated test comments and updated SparkPost default
hostname
-rw-r--r--examples/transmission/configuration_based.php2
-rw-r--r--lib/MessageSystems/SparkPost.php2
-rw-r--r--test/unit/SparkPostTest.php7
-rw-r--r--test/unit/TransmissionTest.php7
4 files changed, 2 insertions, 16 deletions
diff --git a/examples/transmission/configuration_based.php b/examples/transmission/configuration_based.php
index 7f93b05..157d3f3 100644
--- a/examples/transmission/configuration_based.php
+++ b/examples/transmission/configuration_based.php
@@ -24,8 +24,6 @@ try {
]
]);
echo 'Congrats you can use your SDK!';
-
- var_dump(Transmission::$structure);
} catch (\Exception $exception) {
echo $exception->getMessage();
}
diff --git a/lib/MessageSystems/SparkPost.php b/lib/MessageSystems/SparkPost.php
index dfb4295..b1ad20a 100644
--- a/lib/MessageSystems/SparkPost.php
+++ b/lib/MessageSystems/SparkPost.php
@@ -5,7 +5,7 @@ class SparkPost {
private static $config;
private static $defaults = [
- 'host'=>'app.cloudplaceholder.com',
+ 'host'=>'api.sparkpost.com',
'protocol'=>'https',
'port'=>443,
'strictSSL'=>true,
diff --git a/test/unit/SparkPostTest.php b/test/unit/SparkPostTest.php
index b019a15..1b86a8f 100644
--- a/test/unit/SparkPostTest.php
+++ b/test/unit/SparkPostTest.php
@@ -7,7 +7,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Ensures that the configuration class is not instantiable.
- * @covers SparkPost::__construct
*/
public function testConstructorCannotBeCalled() {
$class = new \ReflectionClass('\MessageSystems\SparkPost');
@@ -17,7 +16,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Tests that an exception is thrown when a library tries to recieve the config and it has not yet been set.
* Since its a singleton this test must come before any setConfig tests.
- * @covers SparkPost::getConfig
* @expectedException Exception
* @expectedExceptionMessage No configuration has been provided
*/
@@ -27,7 +25,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Tests that the api key is set when setting the config
- * @covers SparkPost::setConfig
* @expectedException Exception
* @expectedExceptionMessage You must provide an API key
*/
@@ -37,7 +34,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Tests that the api key is set when setting the config and that its not empty
- * @covers SparkPost::setConfig
* @expectedException Exception
* @expectedExceptionMessage You must provide an API key
*/
@@ -47,7 +43,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Tests overridable values are set while invalid values are ignored
- * @covers SparkPost::setConfig
*/
public function testSetConfigMultipleValuesAndGetConfig() {
SparkPost::setConfig(['key'=>'lala', 'version'=>'v8', 'port'=>1024, 'someOtherValue'=>'fakeValue']);
@@ -58,7 +53,7 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(1024, $testConfig['port']);
$this->assertNotContains('someOtherValue', array_keys($testConfig));
$this->assertEquals('https', $testConfig['protocol']);
- $this->assertEquals('app.cloudplaceholder.com', $testConfig['host']);
+ $this->assertEquals('api.sparkpost.com', $testConfig['host']);
$this->assertEquals(true, $testConfig['strictSSL']);
}
}
diff --git a/test/unit/TransmissionTest.php b/test/unit/TransmissionTest.php
index 0e71ddf..ae7d59d 100644
--- a/test/unit/TransmissionTest.php
+++ b/test/unit/TransmissionTest.php
@@ -39,7 +39,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc Ensures that the configuration class is not instantiable.
- * @covers Transmission::__construct
*/
public function testConstructorCannotBeCalled() {
$class = new \ReflectionClass('\MessageSystems\Transmission');
@@ -48,7 +47,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests happy path
- * @covers Transmission::all
*/
public function testAllWithGoodResponse() {
$mock = new Mock([new Response(200, [], Stream::factory('{"results":[{"test":"This is a test"}, {"test":"two"}]}'))]);
@@ -59,7 +57,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests happy path
- * @covers Transmission::find
*/
public function testFindWithGoodResponse() {
$mock = new Mock([new Response(200, [], Stream::factory('{"results":[{"test":"This is a test"}]}'))]);
@@ -70,7 +67,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests 404 bad response
- * @covers Transmission::find
*/
public function testFindWith404Response() {
$mock = new Mock([new Response(404, [])]);
@@ -86,7 +82,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests unknown bad response
- * @covers Transmission::find
*/
public function testFindWithOtherBadResponse() {
$mock = new Mock([new Response(400, [])]);
@@ -102,7 +97,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests happy path
- * @covers Transmission::send
*/
public function testSuccessfulSend() {
$body = ["result"=>["transmission_id"=> "11668787484950529"], "status"=>["message"=> "ok","code"=> "1000"]];
@@ -114,7 +108,6 @@ class TransmissionTest extends \PHPUnit_Framework_TestCase {
/**
* @desc tests bad response
- * @covers Transmission::send
*/
public function testSendForRequestException() {
$body = ['errors'=>['This is a fake error']];