(NFC) Speed up more random tests
authorTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:46:50 +0000 (00:46 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 08:46:50 +0000 (00:46 -0800)
tests/phpunit/CRM/Utils/API/MatchOptionTest.php
tests/phpunit/CRM/Utils/API/ReloadOptionTest.php
tests/phpunit/CRM/Utils/Check/Component/EnvTest.php
tests/phpunit/CRM/Utils/Check/Component/OptionGroupsTest.php
tests/phpunit/CRM/Utils/ColorTest.php

index f6b610812af41a9cfce83553f0fd8cf90a2bdd10..c622abe1a68906818df0e55f0e7c3118edf04fbd 100644 (file)
@@ -12,6 +12,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase {
   public $noise;
 
   public function setUp(): void {
+    $this->useTransaction();
     parent::setUp();
     $this->assertDBQuery(0, "SELECT count(*) FROM civicrm_contact WHERE first_name='Jeffrey' and last_name='Lebowski'");
 
index 01ece92d7c3a357872e2435653acb42065117029..dd20b2674a17633f91e23a769c63afecb348d95b 100644 (file)
@@ -12,6 +12,7 @@
 class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase {
 
   public function setUp(): void {
+    $this->useTransaction();
     parent::setUp();
     CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_post', [$this, 'onPost']);
   }
index 87b6e3a70df8a5105b6c3af0d9c227fce9027dba..0a7d17634a3f9f3b030f1375c92a83071e7e65d9 100644 (file)
@@ -8,6 +8,11 @@
  */
 class CRM_Utils_Check_Component_EnvTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * File check test should fail if reached maximum timeout.
    * @throws \GuzzleHttp\Exception\GuzzleException
index b114d7edb4395f2fa2be34f95a3409142e90509b..e361b91d594d77cf750d32eac9e14d11651bcc41 100644 (file)
@@ -8,6 +8,11 @@
  */
 class CRM_Utils_Check_Component_OptionGroupsTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   public function testCheckOptionGroupValues() {
     $optionGroup = $this->callAPISuccess('OptionGroup', 'create', [
       'name' => 'testGroup',
index 107d258b84a73d622da29e51e88eb0ed2dfba6af..794194fafb72b638b0f41060d0e7dc126d8e4aa3 100644 (file)
@@ -6,6 +6,11 @@
  */
 class CRM_Utils_ColorTest extends CiviUnitTestCase {
 
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @dataProvider contrastExamples
    */