diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 17c2f4fafb1..ffaf227d2dc 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -391,7 +391,7 @@ protected function setUp(): void { // something changed it and then inadvertently didn't restore it. $this->errorHandlerAtStartOfTest = set_error_handler(function($errno, $errstr, $errfile, $errline) {}); restore_error_handler(); - foreach (['civicrm_option_value', 'civicrm_campaign', 'civicrm_line_item', 'civicrm_im', 'civicrm_address'] as $entity) { + foreach (['civicrm_option_value', 'civicrm_campaign', 'civicrm_mailing_spool', 'civicrm_line_item', 'civicrm_im', 'civicrm_address'] as $entity) { $this->entityTracking[$entity] = \CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM ' . $entity); } } @@ -603,6 +603,9 @@ protected function tearDown(): void { if ($entity === 'civicrm_line_item') { $field = 'line_total'; } + if ($entity === 'civicrm_mailing_spool') { + $field = 'recipient_email'; + } $this->assertEquals($count, \CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM ' . $entity), $entity . ' has not cleaned up well ' . CRM_Core_DAO::singleValueQuery('SELECT ' . $field . ' FROM ' . $entity . ' ORDER BY id DESC LIMIT 1')); } parent::tearDown();