Skip to content

Commit 72855df

Browse files
committed
chore(ci): add OAuth2OAuth2SponsorshipTypeApiTest
chore(unit-test): fix OAuth2OAuth2SponsorshipTypeApiTest
1 parent b28329a commit 72855df

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
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

tests/OAuth2OAuth2SponsorshipTypeApiTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*/

0 commit comments

Comments
 (0)