Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CiviUnitTestCase (etal) - Resolve spooky interaction #25855

Merged
merged 7 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Activity/Form/Task/PDFTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class CRM_Activity_Form_Task_PDFTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Contact/BAO/RelationshipCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
class CRM_Contact_BAO_RelationshipCacheTest extends CiviUnitTestCase {

protected function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
$this->useTransaction(TRUE);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Contact/Page/AjaxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase {
protected $originalRequest = [];

public function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
$this->useTransaction(TRUE);
$this->originalRequest = $_REQUEST;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Core/ManagedEntitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
protected $fixtures;

public function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
$this->useTransaction(TRUE);
$this->modules = [
'one' => new CRM_Core_Module('com.example.one', TRUE),
'two' => new CRM_Core_Module('com.example.two', TRUE),
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Event/Form/ParticipantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class CRM_Event_Form_ParticipantTest extends CiviUnitTestCase {
protected $fromEmailAddressOptions = [];

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase {
use CRMTraits_Profile_ProfileTrait;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
$this->useTransaction(TRUE);
$this->organizationCreate();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase {
private $_mut;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0;

$this->_groupID = $this->groupCreate();
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Mailing/MailStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class CRM_Mailing_MailStoreTest extends \CiviUnitTestCase {
protected $workDir;

public function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
$this->useTransaction(TRUE);
$this->workDir = tempnam(sys_get_temp_dir(), 'mailstoretest');
@unlink($this->workDir);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Mailing/TokensTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
class CRM_Mailing_TokensTest extends \CiviUnitTestCase {

protected function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
$this->callAPISuccess('mail_settings', 'get',
['api.mail_settings.create' => ['domain' => 'chaos.org']]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/API/MatchOptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase {
public $noise;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
$this->assertDBQuery(0, "SELECT count(*) FROM civicrm_contact WHERE first_name='Jeffrey' and last_name='Lebowski'");

// Create noise to ensure we don't accidentally/coincidentally match the first record
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/API/ReloadOptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_post', [$this, 'onPost']);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/ArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testAsColumns() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/AutoCleanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class CRM_Utils_AutoCleanTest extends CiviUnitTestCase {
public $foo;

protected function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testAutoclean() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/Check/Component/EnvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class CRM_Utils_Check_Component_EnvTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class CRM_Utils_Check_Component_OptionGroupsTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testCheckOptionGroupValues() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/ColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_ColorTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class CRM_Utils_DateTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/GlobalStackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_GlobalStackTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/HTMLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class CRM_Utils_HTMLTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/HookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class CRM_Utils_HookTest extends CiviUnitTestCase {
public $hook;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
$this->fakeModules = [
'hooktesta',
'hooktestb',
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/HtmlToTextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_HtmlToTextTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase {
protected $client;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();

$this->tmpFile = $this->createTempDir() . '/example.txt';

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/ICalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class CRM_Utils_ICalendarTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/JSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class CRM_Utils_JSTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/LazyArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_LazyArrayTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testAssoc() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/Mail/FilteredPearMailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_Mail_FilteredPearMailerTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testFilter() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/Mail/IncomingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class CRM_Utils_Mail_IncomingTest extends CiviUnitTestCase {
protected $name;

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();

$rand = rand(0, 1000);
$this->email = "test{$rand}@example.com";
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/MailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_MailTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/MoneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
class CRM_Utils_MoneyTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_NumberTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/PDF/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_PDF_UtilsTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/RuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SQL/DeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_SQL_DeleteTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testGetDefault() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SQL/InsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testRow_twice() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SQL/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testGetDefault() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SQLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class CRM_Utils_SQLTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testInterpolate() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SignerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class CRM_Utils_SignerTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testSignValidate() {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class CRM_Utils_StringTest extends CiviUnitTestCase {
* Set up for tests.
*/
public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testBase64Url(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Utils/SystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
class CRM_Utils_SystemTest extends CiviUnitTestCase {

public function setUp(): void {
$this->useTransaction();
parent::setUp();
$this->useTransaction();
}

public function testUrlQueryString() {
Expand Down
Loading