From bc06f843496d3be4aa796be7400be18222bf7541 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 1 Oct 2021 17:12:16 +1300 Subject: [PATCH] Rename test clas to reflect tested class name --- .../Task/{EmailCommonTest.php => EmailTest.php} | 13 +++++-------- .../CRM/Mailing/Form/Task/AdhocMailingTest.php | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) rename tests/phpunit/CRM/Contact/Form/Task/{EmailCommonTest.php => EmailTest.php} (93%) diff --git a/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php b/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php similarity index 93% rename from tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php rename to tests/phpunit/CRM/Contact/Form/Task/EmailTest.php index 930bfbebc2..e7f05091f3 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php @@ -12,15 +12,14 @@ use Civi\Api4\Activity; /** - * Test class for CRM_Contact_Form_Task_EmailCommon. + * Test class for CRM_Contact_Form_Task_Email. * @group headless */ -class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase { +class CRM_Contact_Form_Task_EmailTest extends CiviUnitTestCase { /** * Set up for tests. * - * @throws \CRM_Core_Exception */ protected function setUp(): void { parent::setUp(); @@ -46,16 +45,14 @@ class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase { /** * Test generating domain emails - * - * @throws \CRM_Core_Exception */ - public function testDomainEmailGeneration() { + public function testDomainEmailGeneration(): void { $emails = CRM_Core_BAO_Email::domainEmails(); $this->assertNotEmpty($emails); $optionValue = $this->callAPISuccess('OptionValue', 'Get', [ 'id' => $this->_optionValue['id'], ]); - $this->assertTrue(array_key_exists('"Seamus Lee" ', $emails)); + $this->assertArrayHasKey('"Seamus Lee" ', $emails); $this->assertEquals('"Seamus Lee" ', $optionValue['values'][$this->_optionValue['id']]['label']); } @@ -89,7 +86,7 @@ class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase { 'signature_html' => '

This is a test Signature

', ]); - $to = $form_contactIds = $form_toContactEmails = []; + $to = $form_contactIds = []; for ($i = 0; $i < 27; $i++) { $email = 'spy' . $i . '@secretsquirrels.com'; $contactID = $this->individualCreate(['email' => $email]); diff --git a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php index fb11da8bf1..a0b413935c 100644 --- a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php +++ b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php @@ -9,7 +9,7 @@ +--------------------------------------------------------------------+ */ /** - * Test class for CRM_Contact_Form_Task_EmailCommon. + * Test class for CRM_Mailing_Form_Task_AdhocMailing. * @group headless */ class CRM_Mailing_Form_Task_AdhocMailingTest extends CiviUnitTestCase { -- 2.25.1