(NFC) Speed up more random tests, part 2
authorTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:47:27 +0000 (00:47 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:47:27 +0000 (00:47 -0800)
tests/phpunit/CRM/Utils/GlobalStackTest.php
tests/phpunit/CRM/Utils/HTMLTest.php
tests/phpunit/CRM/Utils/HookTest.php
tests/phpunit/CRM/Utils/HtmlToTextTest.php
tests/phpunit/CRM/Utils/HttpClientTest.php
tests/phpunit/CRM/Utils/ICalendarTest.php
tests/phpunit/CRM/Utils/LazyArrayTest.php

index 7c9c45a86c23eb48f17fc2366ebab8886ae6cded..6f80d998eb0c523e1d60afd1af826db413e77a51 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_GlobalStackTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * Temporarily override global variables and ensure that the variable data.
    * is set as expected (before/during/after the override).
index 2de12a8d1e535b95ae0865f201d2d8e3f610f6a6..8affd0a5c7944d1f8bf13340a97472a3083f98ef 100644 (file)
  */
 class CRM_Utils_HTMLTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @return array
    */
index 4ec39cce8cb36696bc7695de5236dc8bad8fb212..803b47d02f517d4342771b4e118c84997e184f3b 100644 (file)
@@ -13,6 +13,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase {
   public $log;
 
   public function setUp(): void {
+    $this->useTransaction();
     parent::setUp();
     $this->fakeModules = [
       'hooktesta',
index b895ed4fa77e5c0b9edefc49dff6496dab9d2031..67c7881d0d8750e00275e847f09bc7c7aa6e99c2 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_HtmlToTextTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @return array
    */
index 1e607ab943523aaf8b9553b55982b682645faf9b..2890e87d55bbd3791767874095b0539411bc787a 100644 (file)
@@ -25,6 +25,7 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase {
   protected $client;
 
   public function setUp(): void {
+    $this->useTransaction();
     parent::setUp();
 
     $this->tmpFile = $this->createTempDir() . '/example.txt';
index 180e94b6c41170c4de6b229ae11ca4bf939c47cb..a12ea46d859d63ede94d6c2b94fcc89f8a8524b3 100644 (file)
  */
 class CRM_Utils_ICalendarTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @return array
    */
index c48b1455db9f258b454d52f232c0f207a83fcb5c..8f6209a1627e1f5b9efc7054fb0432174fc2c658 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_LazyArrayTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   public function testAssoc() {
     $l = $this->createFruitBasket();
     $this->assertFalse($l->isLoaded());