(NFC) BaseMailingSystemTest - Tweak debug message for assertion
authorTim Otten <totten@civicrm.org>
Thu, 14 Jan 2021 10:28:21 +0000 (02:28 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 14 Jan 2021 10:32:38 +0000 (02:32 -0800)
tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php

index 3e3a9c5402771f5d744d094e2f18936baf1b182d..87670df9ff48505d3d7d8bee8493c0714f7fbaa3 100644 (file)
@@ -325,7 +325,6 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase {
    * @throws \CRM_Core_Exception
    */
   public function testUrlTracking($inputHtml, $htmlUrlRegex, $textUrlRegex, $params) {
-    $caseName = print_r(['inputHtml' => $inputHtml, 'params' => $params], 1);
 
     $allMessages = $this->runMailingSuccess($params + [
       'subject' => 'Example Subject',
@@ -341,11 +340,13 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase {
       list($textPart, $htmlPart) = $message->body->getParts();
 
       if ($htmlUrlRegex) {
+        $caseName = print_r(['inputHtml' => $inputHtml, 'params' => $params, 'htmlUrlRegex' => $htmlUrlRegex, 'htmlPart' => $htmlPart->text], 1);
         $this->assertEquals('html', $htmlPart->subType, "Should have HTML part in case: $caseName");
         $this->assertRegExp($htmlUrlRegex, $htmlPart->text, "Should have correct HTML in case: $caseName");
       }
 
       if ($textUrlRegex) {
+        $caseName = print_r(['inputHtml' => $inputHtml, 'params' => $params, 'textUrlRegex' => $textUrlRegex, 'textPart' => $textPart->text], 1);
         $this->assertEquals('plain', $textPart->subType, "Should have text part in case: $caseName");
         $this->assertRegExp($textUrlRegex, $textPart->text, "Should have correct text in case: $caseName");
       }