From 3698933a3246ecc363a986151cbed483c84b7999 Mon Sep 17 00:00:00 2001 From: Anthony Alaan Date: Tue, 3 Sep 2024 14:55:19 +0800 Subject: [PATCH] Fix incorrect team urls --- lib/Github/Api/Copilot/Usage.php | 4 ++-- test/Github/Tests/Api/Copilot/UsageTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Github/Api/Copilot/Usage.php b/lib/Github/Api/Copilot/Usage.php index 7ef246a9424..0110a58bb40 100644 --- a/lib/Github/Api/Copilot/Usage.php +++ b/lib/Github/Api/Copilot/Usage.php @@ -14,7 +14,7 @@ public function orgUsageSummary(string $organization, array $params = []): array public function orgTeamUsageSummary(string $organization, string $teamSlug, array $params = []): array { return $this->get( - '/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($teamSlug).'/copilot/usage', + '/orgs/'.rawurlencode($organization).'/team/'.rawurlencode($teamSlug).'/copilot/usage', $params ); } @@ -27,7 +27,7 @@ public function enterpriseUsageSummary(string $enterprise, array $params = []): public function enterpriseTeamUsageSummary(string $enterprise, string $teamSlug, array $params = []): array { return $this->get( - '/enterprises/'.rawurlencode($enterprise).'/teams/'.rawurlencode($teamSlug).'/copilot/usage', + '/enterprises/'.rawurlencode($enterprise).'/team/'.rawurlencode($teamSlug).'/copilot/usage', $params ); } diff --git a/test/Github/Tests/Api/Copilot/UsageTest.php b/test/Github/Tests/Api/Copilot/UsageTest.php index bf60313dd32..c14c3e3ffa8 100644 --- a/test/Github/Tests/Api/Copilot/UsageTest.php +++ b/test/Github/Tests/Api/Copilot/UsageTest.php @@ -33,7 +33,7 @@ public function shouldGetOrgTeamUsageSummary(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('get') - ->with('/orgs/KnpLabs/teams/php-github-api/copilot/usage', []) + ->with('/orgs/KnpLabs/team/php-github-api/copilot/usage', []) ->will($this->returnValue($expectedValue)); $this->assertEquals($expectedValue, $api->orgTeamUsageSummary('KnpLabs', 'php-github-api')); @@ -65,7 +65,7 @@ public function shouldGetEnterpriseTeamUsageSummary(): void $api = $this->getApiMock(); $api->expects($this->once()) ->method('get') - ->with('/enterprises/KnpLabs/teams/php-github-api/copilot/usage', []) + ->with('/enterprises/KnpLabs/team/php-github-api/copilot/usage', []) ->will($this->returnValue($expectedValue)); $this->assertEquals($expectedValue, $api->enterpriseTeamUsageSummary('KnpLabs', 'php-github-api'));