Skip to content

Commit 1fdabdb

Browse files
committed
MA-946 #time 20m updated test comments and updated SparkPost default
hostname
1 parent 1d6fad1 commit 1fdabdb

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

examples/transmission/configuration_based.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
]
2525
]);
2626
echo 'Congrats you can use your SDK!';
27-
28-
var_dump(Transmission::$structure);
2927
} catch (\Exception $exception) {
3028
echo $exception->getMessage();
3129
}

lib/MessageSystems/SparkPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class SparkPost {
55

66
private static $config;
77
private static $defaults = [
8-
'host'=>'app.cloudplaceholder.com',
8+
'host'=>'api.sparkpost.com',
99
'protocol'=>'https',
1010
'port'=>443,
1111
'strictSSL'=>true,

test/unit/SparkPostTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class SparkPostTest extends \PHPUnit_Framework_TestCase {
77

88
/**
99
* @desc Ensures that the configuration class is not instantiable.
10-
* @covers SparkPost::__construct
1110
*/
1211
public function testConstructorCannotBeCalled() {
1312
$class = new \ReflectionClass('\MessageSystems\SparkPost');
@@ -17,7 +16,6 @@ public function testConstructorCannotBeCalled() {
1716
/**
1817
* @desc Tests that an exception is thrown when a library tries to recieve the config and it has not yet been set.
1918
* Since its a singleton this test must come before any setConfig tests.
20-
* @covers SparkPost::getConfig
2119
* @expectedException Exception
2220
* @expectedExceptionMessage No configuration has been provided
2321
*/
@@ -27,7 +25,6 @@ public function testGetConfigEmptyException() {
2725

2826
/**
2927
* @desc Tests that the api key is set when setting the config
30-
* @covers SparkPost::setConfig
3128
* @expectedException Exception
3229
* @expectedExceptionMessage You must provide an API key
3330
*/
@@ -37,7 +34,6 @@ public function testSetConfigAPIKeyNotSetException() {
3734

3835
/**
3936
* @desc Tests that the api key is set when setting the config and that its not empty
40-
* @covers SparkPost::setConfig
4137
* @expectedException Exception
4238
* @expectedExceptionMessage You must provide an API key
4339
*/
@@ -47,7 +43,6 @@ public function testSetConfigAPIKeyEmptyException() {
4743

4844
/**
4945
* @desc Tests overridable values are set while invalid values are ignored
50-
* @covers SparkPost::setConfig
5146
*/
5247
public function testSetConfigMultipleValuesAndGetConfig() {
5348
SparkPost::setConfig(['key'=>'lala', 'version'=>'v8', 'port'=>1024, 'someOtherValue'=>'fakeValue']);
@@ -58,7 +53,7 @@ public function testSetConfigMultipleValuesAndGetConfig() {
5853
$this->assertEquals(1024, $testConfig['port']);
5954
$this->assertNotContains('someOtherValue', array_keys($testConfig));
6055
$this->assertEquals('https', $testConfig['protocol']);
61-
$this->assertEquals('app.cloudplaceholder.com', $testConfig['host']);
56+
$this->assertEquals('api.sparkpost.com', $testConfig['host']);
6257
$this->assertEquals(true, $testConfig['strictSSL']);
6358
}
6459
}

test/unit/TransmissionTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function setUp() {
3939

4040
/**
4141
* @desc Ensures that the configuration class is not instantiable.
42-
* @covers Transmission::__construct
4342
*/
4443
public function testConstructorCannotBeCalled() {
4544
$class = new \ReflectionClass('\MessageSystems\Transmission');
@@ -48,7 +47,6 @@ public function testConstructorCannotBeCalled() {
4847

4948
/**
5049
* @desc tests happy path
51-
* @covers Transmission::all
5250
*/
5351
public function testAllWithGoodResponse() {
5452
$mock = new Mock([new Response(200, [], Stream::factory('{"results":[{"test":"This is a test"}, {"test":"two"}]}'))]);
@@ -59,7 +57,6 @@ public function testAllWithGoodResponse() {
5957

6058
/**
6159
* @desc tests happy path
62-
* @covers Transmission::find
6360
*/
6461
public function testFindWithGoodResponse() {
6562
$mock = new Mock([new Response(200, [], Stream::factory('{"results":[{"test":"This is a test"}]}'))]);
@@ -70,7 +67,6 @@ public function testFindWithGoodResponse() {
7067

7168
/**
7269
* @desc tests 404 bad response
73-
* @covers Transmission::find
7470
*/
7571
public function testFindWith404Response() {
7672
$mock = new Mock([new Response(404, [])]);
@@ -86,7 +82,6 @@ public function testFindWith404Response() {
8682

8783
/**
8884
* @desc tests unknown bad response
89-
* @covers Transmission::find
9085
*/
9186
public function testFindWithOtherBadResponse() {
9287
$mock = new Mock([new Response(400, [])]);
@@ -102,7 +97,6 @@ public function testFindWithOtherBadResponse() {
10297

10398
/**
10499
* @desc tests happy path
105-
* @covers Transmission::send
106100
*/
107101
public function testSuccessfulSend() {
108102
$body = ["result"=>["transmission_id"=> "11668787484950529"], "status"=>["message"=> "ok","code"=> "1000"]];
@@ -114,7 +108,6 @@ public function testSuccessfulSend() {
114108

115109
/**
116110
* @desc tests bad response
117-
* @covers Transmission::send
118111
*/
119112
public function testSendForRequestException() {
120113
$body = ['errors'=>['This is a fake error']];

0 commit comments

Comments
 (0)