From d60d70184b7a62d3d8642c25e38280a62a433db0 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 26 Jan 2023 00:51:33 -0800 Subject: [PATCH] (NFC) Speed up more random tests, part 3 (26s=>15s) --- tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php | 5 +++++ tests/phpunit/CRM/Utils/Mail/IncomingTest.php | 1 + tests/phpunit/CRM/Utils/MailTest.php | 5 +++++ tests/phpunit/CRM/Utils/MoneyTest.php | 5 +++++ tests/phpunit/CRM/Utils/NumberTest.php | 5 +++++ tests/phpunit/CRM/Utils/PDF/UtilsTest.php | 5 +++++ 6 files changed, 26 insertions(+) diff --git a/tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php b/tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php index 56b257c9d6..fe4796db8a 100644 --- a/tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php +++ b/tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_Mail_FilteredPearMailerTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + public function testFilter() { $mock = new class() extends \Mail { public $buf = []; diff --git a/tests/phpunit/CRM/Utils/Mail/IncomingTest.php b/tests/phpunit/CRM/Utils/Mail/IncomingTest.php index 96963f8fe9..2e1073106e 100644 --- a/tests/phpunit/CRM/Utils/Mail/IncomingTest.php +++ b/tests/phpunit/CRM/Utils/Mail/IncomingTest.php @@ -32,6 +32,7 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase { protected $name; public function setUp(): void { + $this->useTransaction(); parent::setUp(); $rand = rand(0, 1000); diff --git a/tests/phpunit/CRM/Utils/MailTest.php b/tests/phpunit/CRM/Utils/MailTest.php index d1c6200703..bd287856c4 100644 --- a/tests/phpunit/CRM/Utils/MailTest.php +++ b/tests/phpunit/CRM/Utils/MailTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_MailTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * Test case for add( ) * test with empty params. diff --git a/tests/phpunit/CRM/Utils/MoneyTest.php b/tests/phpunit/CRM/Utils/MoneyTest.php index ce47e3b01e..eb404bbb0a 100644 --- a/tests/phpunit/CRM/Utils/MoneyTest.php +++ b/tests/phpunit/CRM/Utils/MoneyTest.php @@ -7,6 +7,11 @@ */ class CRM_Utils_MoneyTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @dataProvider subtractCurrenciesDataProvider * @param string $leftOp diff --git a/tests/phpunit/CRM/Utils/NumberTest.php b/tests/phpunit/CRM/Utils/NumberTest.php index ea7af8ddab..9ed164204d 100644 --- a/tests/phpunit/CRM/Utils/NumberTest.php +++ b/tests/phpunit/CRM/Utils/NumberTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_NumberTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * @return array */ diff --git a/tests/phpunit/CRM/Utils/PDF/UtilsTest.php b/tests/phpunit/CRM/Utils/PDF/UtilsTest.php index fbc459f456..0a7c97ad8a 100644 --- a/tests/phpunit/CRM/Utils/PDF/UtilsTest.php +++ b/tests/phpunit/CRM/Utils/PDF/UtilsTest.php @@ -6,6 +6,11 @@ */ class CRM_Utils_PDF_UtilsTest extends CiviUnitTestCase { + public function setUp(): void { + $this->useTransaction(); + parent::setUp(); + } + /** * Test user-supplied settings for DOMPDF */ -- 2.25.1