@@ -841,6 +841,53 @@ public function testDeletingAllGiftCertificatesDeletesToTheAllGiftCertificatesRe
841841
842842 Client::deleteAllGiftCertificates ();
843843 }
844+
845+
846+ public function testGettingWebhooksReturnsAllWebhooks ()
847+ {
848+ $ this ->connection ->expects ($ this ->once ())
849+ ->method ('get ' )
850+ ->with ($ this ->basePath . '/hooks ' , false )
851+ ->will ($ this ->returnValue (array (new \Bigcommerce \Api \Resource (),new \Bigcommerce \Api \Resource ())));
852+ $ collection = Client::listWebhooks ();
853+ $ this ->assertInternalType ('array ' , $ collection );
854+ foreach ($ collection as $ resource ) {
855+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resource ' , $ resource );
856+ }
857+ }
858+
859+ public function testGettingSpecifiedWebhookReturnsTheSpecifiedWebhook ()
860+ {
861+ $ this ->connection ->expects ($ this ->once ())
862+ ->method ('get ' )
863+ ->with ($ this ->basePath . '/hooks/1 ' , false )
864+ ->will ($ this ->returnValue (new \Bigcommerce \Api \Resource ()));
865+ $ resource = Client::getWebhook (1 );
866+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resource ' , $ resource );
867+ }
868+
869+ public function testCreatingWebhookPostsToTheSpecifiedResource ()
870+ {
871+ $ this ->connection ->expects ($ this ->once ())
872+ ->method ('post ' )
873+ ->with ($ this ->basePath . '/hooks ' , (object )array ());
874+ Client::createWebhook (array ());
875+ }
876+ public function testUpdatingWebhookPutsToTheSpecifiedResource ()
877+ {
878+ $ this ->connection ->expects ($ this ->once ())
879+ ->method ('put ' )
880+ ->with ($ this ->basePath . '/hooks/1 ' , (object )array ());
881+ Client::updateWebhook (1 , array ());
882+ }
883+
884+ public function testDeleteWebhookDeletesToTheSpecifiedResource ()
885+ {
886+ $ this ->connection ->expects ($ this ->once ())
887+ ->method ('delete ' )
888+ ->with ($ this ->basePath . '/hooks/1 ' );
889+ Client::deleteWebhook (1 );
890+ }
844891
845892 public function testCreatingProductReviewPostsToTheProductReviewResource ()
846893 {
0 commit comments