(NFC) Speed up more random tests, part 3 (26s=>15s)
authorTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:51:33 +0000 (00:51 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:58:14 +0000 (00:58 -0800)
tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php
tests/phpunit/CRM/Utils/Mail/IncomingTest.php
tests/phpunit/CRM/Utils/MailTest.php
tests/phpunit/CRM/Utils/MoneyTest.php
tests/phpunit/CRM/Utils/NumberTest.php
tests/phpunit/CRM/Utils/PDF/UtilsTest.php

index 56b257c9d6a8f9cb8db725f581d0a6f7cc640875..fe4796db8ae0788f37c4938dad85bd93aa0d4a4d 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_Mail_FilteredPearMailerTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   public function testFilter() {
     $mock = new class() extends \Mail {
       public $buf = [];
index 96963f8fe97f7ffb2c324bef59b324f640a2089d..2e1073106e1e1c6b2fe8141a9bd3d7b4b4353646 100644 (file)
@@ -32,6 +32,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase {
   protected $name;
 
   public function setUp(): void {
+    $this->useTransaction();
     parent::setUp();
 
     $rand = rand(0, 1000);
index d1c620070372ecde79336ae996009a2d8c7d1802..bd287856c4f70c8f5abec8c02ad57bb11f0e8a5f 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_MailTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * Test case for add( )
    * test with empty params.
index ce47e3b01e5871b0ae7fcd63d05c0543a79275ef..eb404bbb0acdd9398d50fd9dfe5bbba691f88c00 100644 (file)
@@ -7,6 +7,11 @@
  */
 class CRM_Utils_MoneyTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @dataProvider subtractCurrenciesDataProvider
    * @param string $leftOp
index ea7af8ddabfc87a6b5f815a75143addade667f8a..9ed164204df827b11efceeccf0543f09e3f18340 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_NumberTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @return array
    */
index fbc459f4563f6ec5709c073823f9dfca816497eb..0a7c97ad8ae8c859c9b743e81f09f841a6f245dd 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_PDF_UtilsTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * Test user-supplied settings for DOMPDF
    */