Skip to content

Commit

Permalink
Minor test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 15, 2025
1 parent cace6ab commit c2e30a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/api/v3/MailingABTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/api/v3/MailingContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit c2e30a7

Please sign in to comment.