-
Notifications
You must be signed in to change notification settings - Fork 19
Kontrola existence cesty k veřejnému klíči #24
Conversation
This is better for documentation purposes of this test - invalid public key does not affect if pkp can be counted or not
Paths are checked early in constructor, so it can be checked only once on object constructing and close to source of bug.
d2c4198
to
a7f5801
Compare
a7f5801
to
b0fb3d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 jen pár drobných změn prosím
@@ -16,6 +16,12 @@ class CryptographyService | |||
|
|||
public function __construct(string $privateKeyFile, string $publicKeyFile, string $privateKeyPassword = '') | |||
{ | |||
if (!file_exists($privateKeyFile)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spíš is_file
file_exists
vrací true i pro adresáře
} catch (\PHPUnit\Framework\AssertionFailedError $exception) { | ||
throw $exception; | ||
} catch (\Throwable $exception) { | ||
$this->assertInstanceOf($expectedExceptionType, $exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tady by se hodilo spíš $this->expectException
/** | ||
* @var string | ||
*/ | ||
private $publicKeyFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anotaci na jeden řádek
@@ -65,6 +65,7 @@ public function getBkpCode(string $pkpCode): string | |||
|
|||
public function addWSESignature(string $request): string | |||
{ | |||
$this->tryLoadPublicKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asi bych do metody posílal už obsah souboru, nebude se muset načítat 2x.
Přejmenoval bych metodu na verifyPublicKey
No description provided.