projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d4ad9d
)
Fix for ReportTest when launching a pdf
author
eileen
<emcnaughton@wikimedia.org>
Tue, 2 Feb 2021 00:59:37 +0000
(13:59 +1300)
committer
eileen
<emcnaughton@wikimedia.org>
Tue, 2 Feb 2021 01:00:13 +0000
(14:00 +1300)
CRM/Utils/PDF/Utils.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/PDF/Utils.php
b/CRM/Utils/PDF/Utils.php
index 7ea2bcf12f04152756c7f39833f0207d24fe85f2..526202cb7c1f907425d6e5f6d9bb8296d1222f99 100644
(file)
--- a/
CRM/Utils/PDF/Utils.php
+++ b/
CRM/Utils/PDF/Utils.php
@@
-193,7
+193,9
@@
class CRM_Utils_PDF_Utils {
}
// CRM-19183 remove .pdf extension from filename
$fileName = basename($fileName, ".pdf");
- if (CIVICRM_UF === 'UnitTests') {
+ if (CIVICRM_UF === 'UnitTests' && headers_sent()) {
+ // Streaming content will 'die' in unit tests unless ob_start()
+ // has been called.
throw new CRM_Core_Exception_PrematureExitException('_html2pdf_dompdf called', [
'html' => $html,
'fileName' => $fileName,