Skip to content

Commit 070109d

Browse files
committed
chore: add test to cover scenario of password with quote
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent a044ff3 commit 070109d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/JSignPDFTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ public function testSignSuccess()
6767
$this->assertNotNull($fileSigned);
6868
}
6969

70+
public function testSignUsingPasswordWithQuote()
71+
{
72+
if (!class_exists('JSignPDF\JSignPDFBin\JavaCommandService')) {
73+
$this->markTestSkipped('Install jsignpdf/jsignpdf-bin');
74+
}
75+
$params = JSignParamBuilder::instance()->withDefault();
76+
$password = "with ' quote";
77+
$params->setCertificate($this->getNewCert($password));
78+
$params->setPassword($password);
79+
$fileSigned = $this->service->sign($params);
80+
$this->assertNotNull($fileSigned);
81+
}
82+
7083
public function testCertificateExpired()
7184
{
7285
if (!class_exists('JSignPDF\JSignPDFBin\JavaCommandService')) {

0 commit comments

Comments
 (0)