@@ -722,4 +722,58 @@ protected function getApiClass()
722722 {
723723 return \Github \Api \Repo::class;
724724 }
725+
726+ /**
727+ * @test
728+ */
729+ public function shouldCheckVulnerabilityAlertsEnabled ()
730+ {
731+ $ expectedResponse = '' ;
732+
733+ $ api = $ this ->getApiMock ();
734+
735+ $ api
736+ ->expects ($ this ->once ())
737+ ->method ('get ' )
738+ ->with ('/repos/KnpLabs/php-github-api/vulnerability-alerts ' )
739+ ->will ($ this ->returnValue ($ expectedResponse ));
740+
741+ $ this ->assertEquals ($ expectedResponse , $ api ->isVulnerabilityAlertsEnabled ('KnpLabs ' , 'php-github-api ' ));
742+ }
743+
744+ /**
745+ * @test
746+ */
747+ public function shouldEnableVulnerabilityAlerts ()
748+ {
749+ $ expectedResponse = '' ;
750+
751+ $ api = $ this ->getApiMock ();
752+
753+ $ api
754+ ->expects ($ this ->once ())
755+ ->method ('put ' )
756+ ->with ('/repos/KnpLabs/php-github-api/vulnerability-alerts ' )
757+ ->will ($ this ->returnValue ($ expectedResponse ));
758+
759+ $ this ->assertEquals ($ expectedResponse , $ api ->enableVulnerabilityAlerts ('KnpLabs ' , 'php-github-api ' ));
760+ }
761+
762+ /**
763+ * @test
764+ */
765+ public function shouldDisableVulnerabilityAlerts ()
766+ {
767+ $ expectedResponse = '' ;
768+
769+ $ api = $ this ->getApiMock ();
770+
771+ $ api
772+ ->expects ($ this ->once ())
773+ ->method ('delete ' )
774+ ->with ('/repos/KnpLabs/php-github-api/vulnerability-alerts ' )
775+ ->will ($ this ->returnValue ($ expectedResponse ));
776+
777+ $ this ->assertEquals ($ expectedResponse , $ api ->disableVulnerabilityAlerts ('KnpLabs ' , 'php-github-api ' ));
778+ }
725779}
0 commit comments