-
-
Notifications
You must be signed in to change notification settings - Fork 592
Expand file tree
/
Copy pathDependabotTest.php
More file actions
38 lines (31 loc) · 911 Bytes
/
DependabotTest.php
File metadata and controls
38 lines (31 loc) · 911 Bytes
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
<?php
namespace Github\Tests\Api\Organization;
use Github\Api\Organization\SecretScanning;
use Github\Tests\Api\TestCase;
use PHPUnit\Framework\MockObject\MockObject;
class DependabotTest extends TestCase
{
/**
* @test
*/
public function shouldGetAlerts()
{
$expectedArray = [
['number' => 1, 'state' => 'open', 'severity' => 'critical'],
];
/** @var SecretScanning|MockObject $api */
$api = $this->getApiMock();
$api
->expects($this->once())
->method('get')
->with('/orgs/KnpLabs/dependabot/alerts')
->will($this->returnValue($expectedArray));
$this->assertEquals($expectedArray, $api->alerts('KnpLabs', [
'severity' => 'critical',
]));
}
protected function getApiClass()
{
return \Github\Api\Organization\Dependabot::class;
}
}