Repository navigation
Expand file tree
/
Copy pathUsageTest.php
More file actions
78 lines (63 loc) · 2.05 KB
/
Copy pathUsageTest.php
File metadata and controls
78 lines (63 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
namespace Github\Tests\Api\Copilot;
use Github\Api\Copilot\Usage;
use Github\Tests\Api\TestCase;
class UsageTest extends TestCase
{
/**
* @test
*/
public function shouldGetOrgUsageSummary(): void
{
$expectedValue = ['usage1', 'usage2'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/orgs/KnpLabs/copilot/usage', [])
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->orgUsageSummary('KnpLabs'));
}
/**
* @test
*/
public function shouldGetOrgTeamUsageSummary(): void
{
$expectedValue = ['usage1', 'usage2'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/orgs/KnpLabs/team/php-github-api/copilot/usage', [])
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->orgTeamUsageSummary('KnpLabs', 'php-github-api'));
}
/**
* @test
*/
public function shouldGetEnterpriseUsageSummary(): void
{
$expectedValue = ['usage1', 'usage2'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/enterprises/KnpLabs/copilot/usage', [])
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->enterpriseUsageSummary('KnpLabs'));
}
/**
* @test
*/
public function shouldGetEnterpriseTeamUsageSummary(): void
{
$expectedValue = ['usage1', 'usage2'];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/enterprises/KnpLabs/team/php-github-api/copilot/usage', [])
->will($this->returnValue($expectedValue));
$this->assertEquals($expectedValue, $api->enterpriseTeamUsageSummary('KnpLabs', 'php-github-api'));
}
protected function getApiClass(): string
{
return Usage::class;
}
}