Rename test clas to reflect tested class name
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 1 Oct 2021 04:12:16 +0000 (17:12 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 1 Oct 2021 04:12:16 +0000 (17:12 +1300)
tests/phpunit/CRM/Contact/Form/Task/EmailTest.php [moved from tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php with 93% similarity]
tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.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 930bfbebc2d39250227d00c74f1f06ccf3c02f79..e7f05091f320572a2570c95fa030615f91947a9b 100644 (file)
 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" <seamus@example.com>', $emails));
+    $this->assertArrayHasKey('"Seamus Lee" <seamus@example.com>', $emails);
     $this->assertEquals('"Seamus Lee" <seamus@example.com>', $optionValue['values'][$this->_optionValue['id']]['label']);
   }
 
@@ -89,7 +86,7 @@ class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase {
       'signature_html' => '<p>This is a test Signature</p>',
     ]);
 
-    $to = $form_contactIds = $form_toContactEmails = [];
+    $to = $form_contactIds = [];
     for ($i = 0; $i < 27; $i++) {
       $email = 'spy' . $i . '@secretsquirrels.com';
       $contactID = $this->individualCreate(['email' => $email]);
index fb11da8bf1c3f61ea197669e06ab89490747873d..a0b413935cddd1c6203f7de244ee3d7019e0bab3 100644 (file)
@@ -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 {