Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Sign/JSignParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class JSignParam
*/
private const CERTIFICATE_PASSWORD_OPTIONS = ['-ksp' => '--keystore-password'];

private const JSIGNPDF_VERSION = '3.1.0';
private const JSIGNPDF_VERSION = '3.2.0';

/** @var array<array-key, string> */
private const DEFAULT_JSIGN_PARAMETERS = ['-a', '-kst' => 'PKCS12'];
Expand Down
11 changes: 8 additions & 3 deletions tests/Integration/SignPdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public function testSignWithAVisibleSignature(): void
'--overwrite',
'-V',
'-pg' => '1',
'-llx' => '50', '-lly' => '50', '-urx' => '300', '-ury' => '150',
'-llx' => '50',
'-lly' => '50',
'-urx' => '300',
'-ury' => '150',
]);

$signed = JSignPDF::instance($params)->sign();
Expand All @@ -86,7 +89,9 @@ public function testSignWithAnExplicitHashAlgorithm(): void

public function testSignAPdfOlderThan16WithTheDefaultParameters(): void
{
$this->expectExceptionMessageMatches('/Creating of signature failed/');
JSignPDF::instance($this->params())->sign();
$signed = JSignPDF::instance($this->params())->sign();

$this->assertStringStartsWith('%PDF-', $signed);
$this->assertStringContainsString('/ByteRange', $signed);
}
}
10 changes: 10 additions & 0 deletions tests/Sign/JSignParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

class JSignParamTest extends TestCase
{
public function testUsesJSignPdf320AsTheDefaultRuntime(): void
{
$params = JSignParam::instance();

$this->assertSame(
'https://github.com/intoolswetrust/jsignpdf/releases/download/JSignPdf_3_2_0/jsignpdf-3.2.0-minimal.zip',
$params->getJSignPdfDownloadUrl()
);
}

#[DataProvider('providerValuesThatLookLikeAPasswordOption')]
public function testKeepsAValueThatLooksLikeAPasswordOptionInTheParameters(string $value): void
{
Expand Down