diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index ffaf227d2dc..01fd491d3ed 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -494,6 +494,9 @@ protected function assertEntityCleanup(): 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')); } } diff --git a/tests/phpunit/api/v3/MailingABTest.php b/tests/phpunit/api/v3/MailingABTest.php index a4cb2061f20..6a353d558c0 100644 --- a/tests/phpunit/api/v3/MailingABTest.php +++ b/tests/phpunit/api/v3/MailingABTest.php @@ -106,7 +106,7 @@ public function testMailerDeleteSuccess(): void { /** * @return array */ - public function groupPctProvider() { + public function groupPctProvider(): array { // array(int $totalSize, int $groupPct, int $expectedCountA, $expectedCountB, $expectedCountC) $cases = []; $cases[] = [400, 7, 28, 28, 344]; @@ -167,7 +167,7 @@ public function testDistribution($totalGroupContacts, $groupPct, $expectedCountA * Create a test. Declare the second mailing a winner. Ensure that key * fields propagate to the final mailing. */ - public function testSubmitWinnderId(): void { + public function testSubmitWinnerId(): void { $checkSyncFields = ['subject', 'body_text']; $result = $this->groupContactCreate($this->_groupID, 20, TRUE); diff --git a/tests/phpunit/api/v3/MailingContactTest.php b/tests/phpunit/api/v3/MailingContactTest.php index c2442871197..8076f02cf9d 100644 --- a/tests/phpunit/api/v3/MailingContactTest.php +++ b/tests/phpunit/api/v3/MailingContactTest.php @@ -26,7 +26,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase { public function tearDown(): void { - $this->quickCleanup(['civicrm_contact', 'civicrm_mailing_recipients', 'civicrm_mailing', 'civicrm_mailing_event_delivered']); + $this->quickCleanup(['civicrm_contact', 'civicrm_mailing_recipients', 'civicrm_mailing_event_queue', 'civicrm_mailing', 'civicrm_mailing_event_delivered']); parent::tearDown(); }