Skip to content

Commit 44de4bc

Browse files
bilboquek0ka
andauthored
fix: correct credentials structure (#432)
Co-authored-by: Konstantin Babushkin <koka@idwrx.com>
1 parent e0ec033 commit 44de4bc

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

tests/unit/Identity/v3/Models/CredentialTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ public function test_it_updates()
3434
$this->credential->projectId = 'bar';
3535

3636
$expectedJson = [
37-
'type' => 'foo',
38-
'project_id' => 'bar',
37+
'credential' => [
38+
'type' => 'foo',
39+
'project_id' => 'bar',
40+
]
3941
];
4042

4143
$this->mockRequest('PATCH', 'credentials/CRED_ID', 'cred', $expectedJson, []);

tests/unit/Identity/v3/ServiceTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,16 @@ public function test_it_creates_credential()
504504
'blob' => "{\"access\":\"--access-key--\",\"secret\":\"--secret-key--\"}",
505505
'projectId' => 'project_id',
506506
'type' => 'ec2',
507-
'userId' => 'user_id'
507+
'userId' => 'user_id',
508508
];
509509

510510
$userJson = [
511-
'blob' => $userOptions['blob'],
512-
'project_id' => $userOptions['projectId'],
513-
'type' => $userOptions['type'],
514-
'user_id' => $userOptions['userId'],
511+
'credential' => [
512+
'blob' => $userOptions['blob'],
513+
'project_id' => $userOptions['projectId'],
514+
'type' => $userOptions['type'],
515+
'user_id' => $userOptions['userId'],
516+
],
515517
];
516518

517519
$this->mockRequest('POST', 'credentials', 'cred', $userJson);

0 commit comments

Comments
 (0)