Skip to content

Commit

Permalink
Check on mailing_spool too
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 12, 2025
1 parent 1079713 commit 52f014b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 52f014b

Please sign in to comment.