Skip to content

Commit 06a5628

Browse files
committed
test: add centered two-column stamp preview
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2ee8370 commit 06a5628

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

tests/Integration/VisibleStampTemplateScenarioTest.php

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ public static function visibleStampLayoutProvider(): iterable
128128
'Date: 2026-05-28T16:40:21+00:00',
129129
],
130130
];
131+
132+
yield 'two columns with centered cells' => [
133+
'slug' => 'two-columns-centered-cells',
134+
'layout' => 'two_columns_centered_cells',
135+
'expectedImageCount' => 2,
136+
'expectedTexts' => [
137+
'Signed with LibreSign',
138+
'Preview Issuer',
139+
'Date: 2026-05-28T16:40:21+00:00',
140+
],
141+
];
131142
}
132143

133144
private function buildLayoutHtml(string $layout, string $backgroundPath, ?string $signaturePath): string
@@ -184,6 +195,22 @@ private function buildLayoutHtml(string $layout, string $backgroundPath, ?string
184195
. '</div>',
185196
$background,
186197
),
198+
'two_columns_centered_cells' => sprintf(
199+
'<div style="display:flex;flex-direction:row;width:100%%;height:100%%;padding:14 18">%s'
200+
. '<div style="display:flex;justify-content:center;align-items:center;width:44%%;height:100%%">'
201+
. '<img src="%s" style="width:320px;height:100px" />'
202+
. '</div>'
203+
. '<div style="display:flex;justify-content:center;align-items:center;width:56%%;height:100%%">'
204+
. '<div style="width:300px;height:120px">'
205+
. '<div style="font-size:20;font-weight:700">Signed with LibreSign</div>'
206+
. '<div style="font-size:18;margin:8 0 0 0">Preview Issuer</div>'
207+
. '<div style="font-size:16;margin:10 0 0 0">Date: 2026-05-28T16:40:21+00:00</div>'
208+
. '</div>'
209+
. '</div>'
210+
. '</div>',
211+
$background,
212+
$this->requireSignaturePath($signaturePath),
213+
),
187214
default => throw new \InvalidArgumentException(sprintf('Unknown visible stamp layout "%s".', $layout)),
188215
};
189216
}
@@ -282,7 +309,11 @@ private function ensureDirectoryExists(string $directory): void
282309

283310
private function layoutUsesSignatureImage(string $layout): bool
284311
{
285-
return in_array($layout, ['signature_and_metadata_right', 'signature_centered'], true);
312+
return in_array(
313+
$layout,
314+
['signature_and_metadata_right', 'signature_centered', 'two_columns_centered_cells'],
315+
true,
316+
);
286317
}
287318

288319
private function escapeAttribute(string $value): string

0 commit comments

Comments
 (0)