(NFC) RuleTest - Speed up ~55%
authorTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 07:57:12 +0000 (23:57 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 26 Jan 2023 07:58:29 +0000 (23:58 -0800)
Before: On local i3-12100, takes ~64s (avg over two runs)

After: On local i3-12100, take ~28s (avg over two runs)

tests/phpunit/CRM/Utils/RuleTest.php

index df346227431488738cb76416e890359e187bcdfd..007887b11cf1c278b5b9cfaa2d94c1e6c9f8c97f 100644 (file)
@@ -6,6 +6,14 @@
  */
 class CRM_Utils_RuleTest extends CiviUnitTestCase {
 
+  /**
+   * Set up for tests.
+   */
+  public function setUp(): void {
+    $this->useTransaction();
+    parent::setUp();
+  }
+
   /**
    * @dataProvider integerDataProvider
    * @param $inputData