diff --git a/models/classes/security/Business/Domain/Key/Key.php b/models/classes/security/Business/Domain/Key/Key.php index 73ba09bfb6..83dc7ba850 100644 --- a/models/classes/security/Business/Domain/Key/Key.php +++ b/models/classes/security/Business/Domain/Key/Key.php @@ -24,16 +24,22 @@ final class Key { - /** @var string */ - private $value; + private string $value; + private ?string $password; - public function __construct(string $value) + public function __construct(string $value, ?string $password = null) { $this->value = $value; + $this->password = $password; } public function getValue(): string { return $this->value; } + + public function getPassword(): ?string + { + return $this->password; + } } diff --git a/test/unit/models/classes/security/Business/Domain/Key/KeyChainCollectionTest.php b/test/unit/models/classes/security/Business/Domain/Key/KeyChainCollectionTest.php index db731876b5..dab83dbc90 100644 --- a/test/unit/models/classes/security/Business/Domain/Key/KeyChainCollectionTest.php +++ b/test/unit/models/classes/security/Business/Domain/Key/KeyChainCollectionTest.php @@ -46,9 +46,7 @@ public function setUp(): void $this->privateKey = new Key('123456'); $this->publicKey = new Key('654321'); $this->subject = new KeyChainCollection( - ...[ new KeyChain(self::ID, self::NAME, $this->publicKey, $this->privateKey), - ] ); } diff --git a/test/unit/models/classes/security/Business/Domain/Key/KeyTest.php b/test/unit/models/classes/security/Business/Domain/Key/KeyTest.php index 67375e2b94..98df04d650 100644 --- a/test/unit/models/classes/security/Business/Domain/Key/KeyTest.php +++ b/test/unit/models/classes/security/Business/Domain/Key/KeyTest.php @@ -32,11 +32,12 @@ class KeyTest extends TestCase public function setUp(): void { - $this->subject = new Key('123456'); + $this->subject = new Key('123456', 'password'); } public function testGetters(): void { $this->assertSame('123456', $this->subject->getValue()); + $this->assertSame('password', $this->subject->getPassword()); } }