Skip to content
Merged
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
5 changes: 2 additions & 3 deletions tests/Unit/BalancePlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public function testGetAccountHolderAdditionalAttributesDoesNotThrow()

public function testGetAccountHolderUnknownEnum()
{
$this->markTestSkipped('This test should be enable when enum parsing is fixed.');

$client = $this->createMockClientUrl(
'tests/Resources/BalancePlatform/get-account-holder-unknown-enum.json'
);
Expand All @@ -70,8 +68,9 @@ public function testGetAccountHolderUnknownEnum()

self::assertEquals('AH3227C223222C5GXQXF658WB', $response->getId());
self::assertEquals(AccountHolder::STATUS_ACTIVE, $response->getStatus());
self::assertEquals("pending", $response['capabilities']['receiveFromPlatformPayments']['verificationStatus']);
self::assertEquals("this is unknown", $response['capabilities']['receiveFromPlatformPayments']['verificationStatus']);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with how other properties of the $response object are accessed (e.g., $response->getId() and $response->getStatus()), it's better to use getter methods for accessing nested properties as well, instead of relying on array access syntax. This improves code clarity, maintainability, and leverages static analysis capabilities of IDEs.

Assuming the AccountHolderCapability object has a getVerificationStatus() method (which is standard for the generated models), this assertion can be rewritten.

            self::assertEquals("this is unknown", $response->getCapabilities()['receiveFromPlatformPayments']->getVerificationStatus());

} catch (\Throwable $e) {
// should not throw an exception
$this->fail('An unexpected exception was thrown: ' . $e->getMessage());
}
}
Expand Down