-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathCredentialTest.php
More file actions
54 lines (40 loc) · 1.25 KB
/
CredentialTest.php
File metadata and controls
54 lines (40 loc) · 1.25 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
<?php
namespace OpenStack\Test\Identity\v3\Models;
use GuzzleHttp\Psr7\Response;
use OpenStack\Identity\v3\Api;
use OpenStack\Identity\v3\Models\Credential;
use OpenStack\Test\TestCase;
class CredentialTest extends TestCase
{
private $credential;
public function setUp(): void
{
$this->rootFixturesDir = dirname(__DIR__);
parent::setUp();
$this->credential = new Credential($this->client->reveal(), new Api());
$this->credential->id = 'CRED_ID';
}
public function test_it_retrieves()
{
$this->mockRequest('GET', 'credentials/CRED_ID', 'cred', null, []);
$this->credential->retrieve();
}
public function test_it_updates()
{
$this->credential->type = 'foo';
$this->credential->projectId = 'bar';
$expectedJson = [
'credential' => [
'type' => 'foo',
'project_id' => 'bar',
]
];
$this->mockRequest('PATCH', 'credentials/CRED_ID', 'cred', $expectedJson, []);
$this->credential->update();
}
public function test_it_deletes()
{
$this->mockRequest('DELETE', 'credentials/CRED_ID', new Response(204), null, []);
$this->credential->delete();
}
}