From 494653ed4ab5667eab829b60b6ce41b6a5305325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= <56207234+maindotdev@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:23:13 +0100 Subject: [PATCH] feat: FTL-18486 run integration tests before release (#32) --- .../lib/Model/FetchIOTAVPResponseOK.php | 4 ++-- tests/Helpers/TestHelper.php | 2 -- .../Integration/IotaClientIntegrationTest.php | 19 ++++++------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/Clients/IotaClient/lib/Model/FetchIOTAVPResponseOK.php b/src/Clients/IotaClient/lib/Model/FetchIOTAVPResponseOK.php index 492d980..6ad111c 100644 --- a/src/Clients/IotaClient/lib/Model/FetchIOTAVPResponseOK.php +++ b/src/Clients/IotaClient/lib/Model/FetchIOTAVPResponseOK.php @@ -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' ]; /** diff --git a/tests/Helpers/TestHelper.php b/tests/Helpers/TestHelper.php index ee76b65..b7d73e4 100644 --- a/tests/Helpers/TestHelper.php +++ b/tests/Helpers/TestHelper.php @@ -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'] ]; } diff --git a/tests/Integration/IotaClientIntegrationTest.php b/tests/Integration/IotaClientIntegrationTest.php index 198e9ae..6139941 100644 --- a/tests/Integration/IotaClientIntegrationTest.php +++ b/tests/Integration/IotaClientIntegrationTest.php @@ -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.'); } }