From 2cbc6c769fae8940d3fb4712429431fadd4f83bc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 26 Jan 2023 00:47:27 -0800 Subject: [PATCH] (NFC) Speed up more random tests, part 2 --- tests/phpunit/CRM/Utils/GlobalStackTest.php | 5 +++++ tests/phpunit/CRM/Utils/HTMLTest.php | 5 +++++ tests/phpunit/CRM/Utils/HookTest.php | 1 + tests/phpunit/CRM/Utils/HtmlToTextTest.php | 5 +++++ tests/phpunit/CRM/Utils/HttpClientTest.php | 1 + tests/phpunit/CRM/Utils/ICalendarTest.php | 5 +++++ tests/phpunit/CRM/Utils/LazyArrayTest.php | 5 +++++ 7 files changed, 27 insertions(+) diff --git a/tests/phpunit/CRM/Utils/GlobalStackTest.php b/tests/phpunit/CRM/Utils/GlobalStackTest.php index 7c9c45a86c..6f80d998eb 100644 --- a/tests/phpunit/CRM/Utils/GlobalStackTest.php +++ b/tests/phpunit/CRM/Utils/GlobalStackTest.php @@ -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). diff --git a/tests/phpunit/CRM/Utils/HTMLTest.php b/tests/phpunit/CRM/Utils/HTMLTest.php index 2de12a8d1e..8affd0a5c7 100644 --- a/tests/phpunit/CRM/Utils/HTMLTest.php +++ b/tests/phpunit/CRM/Utils/HTMLTest.php @@ -15,6 +15,11 @@ */ class CRM_Utils_HTMLTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @return array */ diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index 4ec39cce8c..803b47d02f 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -13,6 +13,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { public $log; public function setUp(): void { + $this->useTransaction(); parent::setUp(); $this->fakeModules = [ 'hooktesta', diff --git a/tests/phpunit/CRM/Utils/HtmlToTextTest.php b/tests/phpunit/CRM/Utils/HtmlToTextTest.php index b895ed4fa7..67c7881d0d 100644 --- a/tests/phpunit/CRM/Utils/HtmlToTextTest.php +++ b/tests/phpunit/CRM/Utils/HtmlToTextTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_HtmlToTextTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @return array */ diff --git a/tests/phpunit/CRM/Utils/HttpClientTest.php b/tests/phpunit/CRM/Utils/HttpClientTest.php index 1e607ab943..2890e87d55 100644 --- a/tests/phpunit/CRM/Utils/HttpClientTest.php +++ b/tests/phpunit/CRM/Utils/HttpClientTest.php @@ -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'; diff --git a/tests/phpunit/CRM/Utils/ICalendarTest.php b/tests/phpunit/CRM/Utils/ICalendarTest.php index 180e94b6c4..a12ea46d85 100644 --- a/tests/phpunit/CRM/Utils/ICalendarTest.php +++ b/tests/phpunit/CRM/Utils/ICalendarTest.php @@ -15,6 +15,11 @@ */ class CRM_Utils_ICalendarTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @return array */ diff --git a/tests/phpunit/CRM/Utils/LazyArrayTest.php b/tests/phpunit/CRM/Utils/LazyArrayTest.php index c48b1455db..8f6209a162 100644 --- a/tests/phpunit/CRM/Utils/LazyArrayTest.php +++ b/tests/phpunit/CRM/Utils/LazyArrayTest.php @@ -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()); -- 2.25.1