From 374e164d008707254d6f9a2ef1c35adea7b890c3 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Sun, 17 Jul 2022 01:04:41 -0400 Subject: [PATCH] Fix test. Don't hide errors. --- CRM/Contact/Form/Task/PDFTrait.php | 2 +- tests/phpunit/CRM/Contact/Form/Task/PDFLetterCommonTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Task/PDFTrait.php b/CRM/Contact/Form/Task/PDFTrait.php index 36734bcd8c36..61e4faad36d9 100644 --- a/CRM/Contact/Form/Task/PDFTrait.php +++ b/CRM/Contact/Form/Task/PDFTrait.php @@ -505,7 +505,7 @@ public function formatMessage(&$message) { ], ]; - $htmlMsg = preg_split($newLineOperators['p']['pattern'], ($message ?? '')); + $htmlMsg = preg_split($newLineOperators['p']['pattern'], $message); foreach ($htmlMsg as $k => & $m) { $messages = preg_split($newLineOperators['br']['pattern'], $m); foreach ($messages as $key => & $msg) { diff --git a/tests/phpunit/CRM/Contact/Form/Task/PDFLetterCommonTest.php b/tests/phpunit/CRM/Contact/Form/Task/PDFLetterCommonTest.php index 3e7fd38c6566..9b7974585cf3 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/PDFLetterCommonTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/PDFLetterCommonTest.php @@ -52,6 +52,7 @@ public function testFilenameIsAssigned(?string $pdfFileName, ?string $activitySu $form = $this->getPDFForm([ 'pdf_file_name' => $pdfFileName, 'subject' => $activitySubject, + 'html_message' => '

', ], [$this->contactId], $isLiveMode); $fileNameAssigned = $this->submitForm($form)['fileName']; $this->assertEquals($expectedFilename, $fileNameAssigned);