@@ -42,4 +42,30 @@ public function testDateTimeConversion()
4242
4343 $ this ->assertEquals ($ testBody , $ this ->sut ->search (["from " => $ testFrom , "to " => $ testTo ]));
4444 }
45+
46+ public function testDocumentation () {
47+ $ testBody = ['results ' => ['my ' => 'test ' ]];
48+ $ responseMock = Mockery::mock ();
49+ $ this ->sparkPostMock ->httpAdapter ->shouldReceive ('send ' )->
50+ once ()->
51+ with ("/message-events/events/documentation " , 'GET ' , Mockery::type ('array ' ), null )->
52+ andReturn ($ responseMock );
53+ $ responseMock ->shouldReceive ('getStatusCode ' )->andReturn (200 );
54+ $ responseMock ->shouldReceive ('getBody->getContents ' )->andReturn (json_encode ($ testBody ));
55+
56+ $ this ->assertEquals ($ testBody , $ this ->sut ->documentation ());
57+ }
58+
59+ public function testSamples () {
60+ $ testBody = ['results ' => ['my ' => 'test ' ]];
61+ $ responseMock = Mockery::mock ();
62+ $ this ->sparkPostMock ->httpAdapter ->shouldReceive ('send ' )->
63+ once ()->
64+ with ("/message-events/events/samples?events= " .urlencode ("delivery,bounce " ), 'GET ' , Mockery::type ('array ' ), null )->
65+ andReturn ($ responseMock );
66+ $ responseMock ->shouldReceive ('getStatusCode ' )->andReturn (200 );
67+ $ responseMock ->shouldReceive ('getBody->getContents ' )->andReturn (json_encode ($ testBody ));
68+
69+ $ this ->assertEquals ($ testBody , $ this ->sut ->samples (["delivery " , "bounce " ]));
70+ }
4571}
0 commit comments