File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 - { name: "OAuth2ElectionsApiController", filter: "--filter test/OAuth2ElectionsApiController"}
7777 - { name: "OAuth2MembersApiTest", filter: "--filter test/OAuth2MembersApiTest"}
7878 - { name: "OAuth2GroupsApiTest", filter: "--filter test/OAuth2GroupsApiTest"}
79+ - { name: "OAuth2OAuth2SponsorshipTypeApiTest", filter: "--filter test/OAuth2OAuth2SponsorshipTypeApiTest"}
7980 env :
8081 OTEL_SERVICE_ENABLED : false
8182 APP_ENV : testing
Original file line number Diff line number Diff line change @@ -85,6 +85,34 @@ public function testGetAllSponsorShipTypes(){
8585 return $ page ;
8686 }
8787
88+ public function testGetSponsorShipTypeById (){
89+ $ sponsorship_type = $ this ->testAddSponsorShipType ();
90+ $ params = [
91+ 'id ' => $ sponsorship_type ->id
92+ ];
93+
94+ $ headers = [
95+ "HTTP_Authorization " => " Bearer " . $ this ->access_token ,
96+ "CONTENT_TYPE " => "application/json "
97+ ];
98+
99+ $ response = $ this ->action (
100+ "GET " ,
101+ "OAuth2SponsorshipTypeApiController@get " ,
102+ $ params ,
103+ [],
104+ [],
105+ [],
106+ $ headers
107+ );
108+
109+ $ content = $ response ->getContent ();
110+ $ this ->assertResponseStatus (200 );
111+ $ result = json_decode ($ content );
112+ $ this ->assertNotNull ($ result );
113+ $ this ->assertEquals ($ sponsorship_type ->id , $ result ->id );
114+ }
115+
88116 /**
89117 * @return mixed
90118 */
You can’t perform that action at this time.
0 commit comments