Skip to content
Snippets Groups Projects

Resolve #3495517 "Add further test coverage"

Files
6
@@ -21,7 +21,7 @@ class TestPdfGenerator extends DoppioPdfGenerator {
public function generatePdf(string $page_url, string $output_file_uri, array $options = []): void {
try {
// Instead of calling the actual API, directly save the mock PDF data.
$this->saveMockPdfToFile($output_file_uri);
$this->saveMockPdfToFile($output_file_uri, $page_url);
}
catch (\Exception $e) {
$this->logger
@@ -34,8 +34,10 @@ class TestPdfGenerator extends DoppioPdfGenerator {
*
* @param string $path
* Destination file path.
* @param string $page_url
* The page URL.
*/
protected function saveMockPdfToFile(string $path): void {
protected function saveMockPdfToFile(string $path, string $page_url): void {
// Mock PDF content.
$pdf_data = <<<PDF
%PDF-1.4
@@ -54,7 +56,7 @@ stream
BT
/F1 24 Tf
100 700 Td
(This is a mock PDF file.) Tj
(Page URL is "{$page_url}") Tj
ET
endstream
endobj
Loading