From: Tim Otten Date: Thu, 26 Jan 2023 08:46:50 +0000 (-0800) Subject: (NFC) Speed up more random tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0c5f4032af9868253478acf9adc13dae53580f98;p=civicrm-core.git (NFC) Speed up more random tests --- diff --git a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php index f6b610812a..c622abe1a6 100644 --- a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php @@ -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'"); diff --git a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php index 01ece92d7c..dd20b2674a 100644 --- a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php @@ -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']); } diff --git a/tests/phpunit/CRM/Utils/Check/Component/EnvTest.php b/tests/phpunit/CRM/Utils/Check/Component/EnvTest.php index 87b6e3a70d..0a7d17634a 100644 --- a/tests/phpunit/CRM/Utils/Check/Component/EnvTest.php +++ b/tests/phpunit/CRM/Utils/Check/Component/EnvTest.php @@ -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 diff --git a/tests/phpunit/CRM/Utils/Check/Component/OptionGroupsTest.php b/tests/phpunit/CRM/Utils/Check/Component/OptionGroupsTest.php index b114d7edb4..e361b91d59 100644 --- a/tests/phpunit/CRM/Utils/Check/Component/OptionGroupsTest.php +++ b/tests/phpunit/CRM/Utils/Check/Component/OptionGroupsTest.php @@ -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', diff --git a/tests/phpunit/CRM/Utils/ColorTest.php b/tests/phpunit/CRM/Utils/ColorTest.php index 107d258b84..794194fafb 100644 --- a/tests/phpunit/CRM/Utils/ColorTest.php +++ b/tests/phpunit/CRM/Utils/ColorTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_ColorTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @dataProvider contrastExamples */