Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: FTL-18486 enable remaining iota integration test assertions #32

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Clients/IotaClient/lib/Model/FetchIOTAVPResponseOK.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $attributeMap = [
'correlation_id' => 'correlationId',
'presentation_submission' => 'presentation_submission',
'vp_token' => 'vp_token'
'presentation_submission' => 'presentationSubmission',
'vp_token' => 'vpToken'
];

/**
Expand Down
2 changes: 0 additions & 2 deletions tests/Helpers/TestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function getConfiguration()
'vpToken' => $_ENV['VP_TOKEN'],
'vc' => $_ENV['VERIFIABLE_CREDENTIAL'],
'vcInvalid' => $_ENV['VERIFIABLE_CREDENTIAL_INVALID'],
'expiredJwt' => $_ENV['EXPIRED_JWT'],
'invalidJwt' => $_ENV['INVALID_JWT'],
'issuanceData' => $_ENV['CREDENTIAL_ISSUANCE_DATA']
];
}
Expand Down
19 changes: 6 additions & 13 deletions tests/Integration/IotaClientIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,14 @@ public function testRedirectFlow()

$this->assertNotEmpty($resultJson);

// TODO: uncomment the below, once iota-service is fixed and clients are regenerated:
// FetchIOTAVPResponseOK Model should have vpToken and presentationSubmission instead of vp_token and presentation_submission

// // Assert that 'vpToken' key exists
// $this->assertArrayHasKey('vpToken', $resultJson, 'The response does not contain a "vpToken" key.');

// $vp = $resultJson['vpToken'];
// $vpJson = json_decode($vp, true);
$this->assertArrayHasKey('vpToken', $resultJson, 'The response does not contain a "vpToken" key.');

// // Assert that the count of credentials is greater than 0
// $credentialsCount = count($vpJson['verifiableCredential']);
// $this->assertGreaterThan(0, $credentialsCount, 'No VCs were returned in the response.');
$vp = $resultJson['vpToken'];
$vpJson = json_decode($vp, true);

// // NOTE: for debugging, no need printing email
// $email = $vpJson['verifiableCredential'][0]['credentialSubject']['email'];
// echo $email;
// Assert that the count of credentials is greater than 0
$credentialsCount = count($vpJson['verifiableCredential']);
$this->assertGreaterThan(0, $credentialsCount, 'No VCs were returned in the response.');
}
}
Loading