diff --git a/src/Service/GlobalAuthenticationService.php b/src/Service/GlobalAuthenticationService.php index 7026ff2..83e26a7 100644 --- a/src/Service/GlobalAuthenticationService.php +++ b/src/Service/GlobalAuthenticationService.php @@ -18,11 +18,11 @@ class GlobalAuthenticationService extends ID3BaseService private GlobalAuthenticationGateway $gateway; /** - * @var string The Profile ID to be used when verifying identities via->verifyIdentity(). + * @var ?string The Profile ID to be used when verifying identities via->verifyIdentity(). * * @see self::setProfileId() */ - private string $profileId = ''; + private ?string $profileId = null; /** * @var int The version of the Profile ID to be used when verifying identities via->verifyIdentity(). @@ -99,7 +99,7 @@ public function verifyIdentity(Identity $identity, ?string $customerReference = $gateway = $this->getGateway(); - if (!$this->profileId) { + if ($this->profileId === null) { $error = 'An ID3global Profile ID must be set by calling setProfileId() before calling verifyIdentity().'; throw new LogicException($error); diff --git a/tests/Service/GlobalAuthenticationServiceTest.php b/tests/Service/GlobalAuthenticationServiceTest.php index 3fc6ee9..ef1b5ee 100644 --- a/tests/Service/GlobalAuthenticationServiceTest.php +++ b/tests/Service/GlobalAuthenticationServiceTest.php @@ -120,7 +120,7 @@ public function fakeResponses(): array { return [ ['profile-id', 1, 'customer-1', GlobalAuthenticationGatewayFake::IDENTITY_BAND_ALERT, 20000], - ['profile-id-2', 0, 'customer-2', GlobalAuthenticationGatewayFake::IDENTITY_BAND_REFER, 500], + ['', 0, '', GlobalAuthenticationGatewayFake::IDENTITY_BAND_REFER, 500], ]; } }