From 39b9dbb318c6dca32d7b61cc94ce2430cb66deb9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 6 Apr 2019 16:07:30 -0700 Subject: [PATCH] (NFC) tests/ - Cleanup phpcbf oddities --- .../main.php | 4 +- tests/phpunit/CRM/Case/BAO/CaseTypeTest.php | 4 +- tests/phpunit/CRM/Case/BAO/QueryTest.php | 13 +++--- tests/phpunit/CRM/Contact/SelectorTest.php | 15 +++---- .../CRM/Contribute/Form/ContributionTest.php | 3 +- tests/phpunit/CRM/Utils/HookTest.php | 2 +- tests/phpunit/CRM/Utils/SystemTest.php | 40 +++++++++++-------- tests/phpunit/api/v3/ContributionTest.php | 3 +- .../phpunit/api/v3/JobProcessMailingTest.php | 4 +- 9 files changed, 47 insertions(+), 41 deletions(-) diff --git a/tests/extensions/test.extension.manager.searchtest/main.php b/tests/extensions/test.extension.manager.searchtest/main.php index f1bcdcd6a1..0611cae2d0 100644 --- a/tests/extensions/test.extension.manager.searchtest/main.php +++ b/tests/extensions/test.extension.manager.searchtest/main.php @@ -51,8 +51,8 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B * * @return mixed * - NULL or array with keys: - * - summary: string - * - total: numeric + * - summary: string + * - total: numeric */ public function summary() { return NULL; diff --git a/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php b/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php index b83fac0cca..413c4acb3c 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTypeTest.php @@ -187,9 +187,9 @@ class CRM_Case_BAO_CaseTypeTest extends CiviUnitTestCase { */ public function normalizeXml($xml) { return trim( - // tags on new lines + // tags on new lines preg_replace(":\n*<:", "\n<", - // no leading whitespace + // no leading whitespace preg_replace("/\n[\n ]+/", "\n", $xml ) diff --git a/tests/phpunit/CRM/Case/BAO/QueryTest.php b/tests/phpunit/CRM/Case/BAO/QueryTest.php index 3543366524..713cf7c92a 100644 --- a/tests/phpunit/CRM/Case/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Case/BAO/QueryTest.php @@ -58,12 +58,13 @@ class CRM_Case_BAO_QueryTest extends CiviUnitTestCase { ); $queryObj = new CRM_Contact_BAO_Query($params, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_CASE); - $this->assertEquals(array( - 0 => 'Activity Type = Contribution', - 1 => 'Activity Type = Scheduled', - 2 => 'Activity Medium = In Person', - ), - $queryObj->_qill[1] + $this->assertEquals( + array( + 0 => 'Activity Type = Contribution', + 1 => 'Activity Type = Scheduled', + 2 => 'Activity Medium = In Person', + ), + $queryObj->_qill[1] ); } diff --git a/tests/phpunit/CRM/Contact/SelectorTest.php b/tests/phpunit/CRM/Contact/SelectorTest.php index 917396028b..e7d0a58cdc 100644 --- a/tests/phpunit/CRM/Contact/SelectorTest.php +++ b/tests/phpunit/CRM/Contact/SelectorTest.php @@ -513,13 +513,14 @@ class CRM_Contact_SelectorTest extends CiviUnitTestCase { $selector = new CRM_Contact_Selector( 'CRM_Contact_Selector', ['custom_' . $createdField['id'] => ['IS NOT EMPTY' => 1]], - [[ - 0 => 'custom_' . $createdField['id'], - 1 => 'IS NOT NULL', - 2 => 1, - 3 => 1, - 4 => 0, - ], + [ + [ + 0 => 'custom_' . $createdField['id'], + 1 => 'IS NOT NULL', + 2 => 1, + 3 => 1, + 4 => 0, + ], ], [], CRM_Core_Action::NONE, diff --git a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php index 81e3540365..629b9d9229 100644 --- a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php @@ -607,8 +607,7 @@ class CRM_Contribute_Form_ContributionTest extends CiviUnitTestCase { $this->callAPISuccessGetCount('Contribution', array('contact_id' => $this->_individualId), 1); $mut->checkMailLog(array( '

Please print this receipt for your records.

', - ) - ); + )); $mut->stop(); } diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index a1e0e6329a..e3167f2002 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -6,7 +6,7 @@ */ class CRM_Utils_HookTest extends CiviUnitTestCase { - protected static $activeTest = NULL; + public static $activeTest = NULL; public $fakeModules; diff --git a/tests/phpunit/CRM/Utils/SystemTest.php b/tests/phpunit/CRM/Utils/SystemTest.php index 66bab81091..457e736329 100644 --- a/tests/phpunit/CRM/Utils/SystemTest.php +++ b/tests/phpunit/CRM/Utils/SystemTest.php @@ -85,25 +85,31 @@ class CRM_Utils_SystemTest extends CiviUnitTestCase { */ public function getURLs() { return [ - ['https://example.com?ab=cd', [ - 'scheme' => 'https', - 'host' => 'example.com', - 'query' => 'ab=cd', + [ + 'https://example.com?ab=cd', + [ + 'scheme' => 'https', + 'host' => 'example.com', + 'query' => 'ab=cd', + ], ], + [ + 'http://myuser:mypass@foo.bar:123/whiz?a=b&c=d', + [ + 'scheme' => 'http', + 'host' => 'foo.bar', + 'port' => 123, + 'user' => 'myuser', + 'pass' => 'mypass', + 'path' => '/whiz', + 'query' => 'a=b&c=d', + ], ], - ['http://myuser:mypass@foo.bar:123/whiz?a=b&c=d', [ - 'scheme' => 'http', - 'host' => 'foo.bar', - 'port' => 123, - 'user' => 'myuser', - 'pass' => 'mypass', - 'path' => '/whiz', - 'query' => 'a=b&c=d', - ], - ], - ['/foo/bar', [ - 'path' => '/foo/bar', - ], + [ + '/foo/bar', + [ + 'path' => '/foo/bar', + ], ], ]; } diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 70d339f052..27a776fc52 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -3049,8 +3049,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $stateOfGrace = $this->callAPISuccess('MembershipStatus', 'getvalue', array( 'name' => 'Grace', 'return' => 'id', - ) - ); + )); $this->setUpPendingContribution($this->_ids['price_field_value'][0]); $membership = $this->callAPISuccess('membership', 'getsingle', array('id' => $this->_ids['membership'])); $logs = $this->callAPISuccess('MembershipLog', 'get', array( diff --git a/tests/phpunit/api/v3/JobProcessMailingTest.php b/tests/phpunit/api/v3/JobProcessMailingTest.php index c96a3f1e5f..1f4e1bfdbf 100644 --- a/tests/phpunit/api/v3/JobProcessMailingTest.php +++ b/tests/phpunit/api/v3/JobProcessMailingTest.php @@ -222,9 +222,9 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { 'mailerJobsMax' => 1, ), array( - // 2 jobs which produce 0 messages + // 2 jobs which produce 0 messages 0 => 2, - // 1 job which produces 4 messages + // 1 job which produces 4 messages 4 => 1, ), 4, -- 2.25.1