diff options
Diffstat (limited to 'test/unit/MessageEventTest.php')
-rw-r--r-- | test/unit/MessageEventTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/MessageEventTest.php b/test/unit/MessageEventTest.php index a91d17a..935939d 100644 --- a/test/unit/MessageEventTest.php +++ b/test/unit/MessageEventTest.php @@ -42,4 +42,30 @@ class MessageEventTest extends \PHPUnit_Framework_TestCase $this->assertEquals($testBody, $this->sut->search(["from" => $testFrom, "to" => $testTo])); } + + public function testDocumentation() { + $testBody = ['results' => ['my' => 'test']]; + $responseMock = Mockery::mock(); + $this->sparkPostMock->httpAdapter->shouldReceive('send')-> + once()-> + with("/message-events/events/documentation", 'GET', Mockery::type('array'), null)-> + andReturn($responseMock); + $responseMock->shouldReceive('getStatusCode')->andReturn(200); + $responseMock->shouldReceive('getBody->getContents')->andReturn(json_encode($testBody)); + + $this->assertEquals($testBody, $this->sut->documentation()); + } + + public function testSamples() { + $testBody = ['results' => ['my' => 'test']]; + $responseMock = Mockery::mock(); + $this->sparkPostMock->httpAdapter->shouldReceive('send')-> + once()-> + with("/message-events/events/samples?events=".urlencode("delivery,bounce"), 'GET', Mockery::type('array'), null)-> + andReturn($responseMock); + $responseMock->shouldReceive('getStatusCode')->andReturn(200); + $responseMock->shouldReceive('getBody->getContents')->andReturn(json_encode($testBody)); + + $this->assertEquals($testBody, $this->sut->samples(["delivery", "bounce"])); + } }
\ No newline at end of file |