From 1d3260ea8a03e74fef5b8916bac7cb2ecbfc30fb Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 26 Jan 2020 11:13:38 +1100 Subject: [PATCH] [NFC] Fix var declarations in the test folder --- .../CRM/Contact/BAO/GroupContactCacheTest.php | 3 ++- .../CRM/Core/BAO/ActionScheduleTest.php | 3 ++- .../CRM/Core/CommunityMessagesTest.php | 3 ++- tests/phpunit/CRM/Core/Config/MailerTest.php | 4 ++- .../phpunit/CRM/Core/ManagedEntitiesTest.php | 2 +- tests/phpunit/CRM/Core/ResourcesTest.php | 3 ++- tests/phpunit/CRM/Core/TransactionTest.php | 3 ++- tests/phpunit/CRM/Utils/HttpClientTest.php | 3 ++- tests/phpunit/Civi/API/KernelTest.php | 3 ++- .../ActionSchedule/AbstractMappingTest.php | 4 +-- tests/phpunit/CiviTest/CiviCaseTestCase.php | 3 ++- tests/phpunit/CiviTest/CiviMailUtils.php | 6 +++-- tests/phpunit/CiviTest/CiviUnitTestCase.php | 26 +++++++++++-------- tests/phpunit/E2E/Cache/TwoInstancesTest.php | 4 +-- .../phpunit/api/v3/SyntaxConformanceTest.php | 3 ++- 15 files changed, 45 insertions(+), 28 deletions(-) diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index 897ebbf453..e4a7eb6a93 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -240,7 +240,8 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { // *** Everything below this should be moved to parent class **** /** - * @var array(DAO_Name => array(int)) List of items to garbage-collect during tearDown + * @var array + * (DAO_Name => array(int)) List of items to garbage-collect during tearDown */ private $_testObjects; diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 247bced643..b2fddc00ae 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -2154,7 +2154,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } /** - * @var array(DAO_Name => array(int)) List of items to garbage-collect during tearDown + * @var array + * (DAO_Name => array(int)) List of items to garbage-collect during tearDown */ private $_testObjects; diff --git a/tests/phpunit/CRM/Core/CommunityMessagesTest.php b/tests/phpunit/CRM/Core/CommunityMessagesTest.php index c87cd6783c..6ebda73e48 100644 --- a/tests/phpunit/CRM/Core/CommunityMessagesTest.php +++ b/tests/phpunit/CRM/Core/CommunityMessagesTest.php @@ -27,7 +27,8 @@ class CRM_Core_CommunityMessagesTest extends CiviUnitTestCase { protected $cache; /** - * @var array list of possible web responses + * @var array + * list of possible web responses */ protected static $webResponses = NULL; diff --git a/tests/phpunit/CRM/Core/Config/MailerTest.php b/tests/phpunit/CRM/Core/Config/MailerTest.php index 5457f0b2b8..43c819117c 100644 --- a/tests/phpunit/CRM/Core/Config/MailerTest.php +++ b/tests/phpunit/CRM/Core/Config/MailerTest.php @@ -24,7 +24,9 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { /** - * @var array (string=>int) Keep count of the #times different functions are called + * Keep count of the #times different functions are called + * @var array + * (string=>int) */ public $calls; diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index 6c61fc0083..dc73e15f4a 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -16,7 +16,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { protected $adhocProvider; /** - * @var array(string + * @var String[] */ protected $modules; diff --git a/tests/phpunit/CRM/Core/ResourcesTest.php b/tests/phpunit/CRM/Core/ResourcesTest.php index da2289c8ce..face0400d7 100644 --- a/tests/phpunit/CRM/Core/ResourcesTest.php +++ b/tests/phpunit/CRM/Core/ResourcesTest.php @@ -26,7 +26,8 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase { protected $mapper; /** - * @var string for testing cache buster generation + * @var string + * For testing cache buster generation */ protected $cacheBusterString = 'xBkdk3'; diff --git a/tests/phpunit/CRM/Core/TransactionTest.php b/tests/phpunit/CRM/Core/TransactionTest.php index 9df2b95107..069980a533 100644 --- a/tests/phpunit/CRM/Core/TransactionTest.php +++ b/tests/phpunit/CRM/Core/TransactionTest.php @@ -12,7 +12,8 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { private $callbackLog; /** - * @var array (int $idx => int $contactId) list of contact IDs that have been created (in order of creation) + * @var array + * (int $idx => int $contactId) list of contact IDs that have been created (in order of creation) * * Note that ID this is all IDs created by the test-case -- even if the creation was subsequently rolled back */ diff --git a/tests/phpunit/CRM/Utils/HttpClientTest.php b/tests/phpunit/CRM/Utils/HttpClientTest.php index 3dea0047dc..39ca92d8cb 100644 --- a/tests/phpunit/CRM/Utils/HttpClientTest.php +++ b/tests/phpunit/CRM/Utils/HttpClientTest.php @@ -14,7 +14,8 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase { const SELF_SIGNED_HTTPS_REGEX = '/This is httpclienttest-selfsign\./'; /** - * @var string path to which we can store temp file + * @var string + * Path to which we can store temp file */ protected $tmpFile; diff --git a/tests/phpunit/Civi/API/KernelTest.php b/tests/phpunit/Civi/API/KernelTest.php index 0dca67834a..63944f2e6d 100644 --- a/tests/phpunit/Civi/API/KernelTest.php +++ b/tests/phpunit/Civi/API/KernelTest.php @@ -9,7 +9,8 @@ class KernelTest extends \CiviUnitTestCase { const MOCK_VERSION = 3; /** - * @var array(int => array('name' => string $eventName, 'type' => string $className)) + * @var array + * (int => array('name' => string $eventName, 'type' => string $className)) */ public $actualEventSequence; diff --git a/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php b/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php index 5483a2e58a..65fe977ef9 100644 --- a/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php +++ b/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php @@ -71,9 +71,9 @@ abstract class AbstractMappingTest extends \CiviUnitTestCase { /** * When comparing timestamps, treat them as the same if they - * occur within a certain distance of each other. + * occur within a certain distance (seconds) of each other. * - * @var int seconds + * @var int */ public $dateTolerance = 120; diff --git a/tests/phpunit/CiviTest/CiviCaseTestCase.php b/tests/phpunit/CiviTest/CiviCaseTestCase.php index 373274a0c3..44b03ad317 100644 --- a/tests/phpunit/CiviTest/CiviCaseTestCase.php +++ b/tests/phpunit/CiviTest/CiviCaseTestCase.php @@ -15,7 +15,8 @@ class CiviCaseTestCase extends CiviUnitTestCase { /** - * @var string symbolic-name + * @var string + * Symbolic-name */ protected $caseType; diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index d2986a2d2d..ec1c66579e 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -31,12 +31,14 @@ class CiviMailUtils extends PHPUnit\Framework\TestCase { /** - * @var mixed current outbound email option + * Current outbound email option + * @var mixed */ protected $_outBound_option = NULL; /** - * @var bool is this a webtest + * Is this a webtest + * @var bool */ protected $_webtest = FALSE; diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 933c3fca80..170d7f410d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -90,12 +90,14 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { protected $_tablesToTruncate = []; /** - * @var array of temporary directory names + * @var array + * Array of temporary directory names */ protected $tempDirs; /** - * @var bool populateOnce allows to skip db resets in setUp + * @var bool + * populateOnce allows to skip db resets in setUp * * WARNING! USE WITH CAUTION - IT'LL RENDER DATA DEPENDENCIES * BETWEEN TESTS WHEN RUN IN SUITE. SUITABLE FOR LOCAL, LIMITED @@ -103,21 +105,22 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * * IF POSSIBLE, USE $this->DBResetRequired = FALSE IN YOUR TEST CASE! * - * see also: http://forum.civicrm.org/index.php/topic,18065.0.html + * @see http://forum.civicrm.org/index.php/topic,18065.0.html */ public static $populateOnce = FALSE; /** - * @var bool DBResetRequired allows skipping DB reset - * in specific test case. If you still need - * to reset single test (method) of such case, call - * $this->cleanDB() in the first line of this - * test (method). + * DBResetRequired allows skipping DB reset + * in specific test case. If you still need + * to reset single test (method) of such case, call + * $this->cleanDB() in the first line of this + * test (method). + * @var bool */ public $DBResetRequired = TRUE; /** - * @var CRM_Core_Transaction|NULL + * @var CRM_Core_Transaction|null */ private $tx = NULL; @@ -138,12 +141,13 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { * * $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults')); * - * @var CRM_Utils_Hook_UnitTests hookClass + * @var \CRM_Utils_Hook_UnitTests */ public $hookClass = NULL; /** - * @var array common values to be re-used multiple times within a class - usually to create the relevant entity + * @var array + * Common values to be re-used multiple times within a class - usually to create the relevant entity */ protected $_params = []; diff --git a/tests/phpunit/E2E/Cache/TwoInstancesTest.php b/tests/phpunit/E2E/Cache/TwoInstancesTest.php index 67f1295ebd..875e692a03 100644 --- a/tests/phpunit/E2E/Cache/TwoInstancesTest.php +++ b/tests/phpunit/E2E/Cache/TwoInstancesTest.php @@ -17,12 +17,12 @@ class E2E_Cache_TwoInstancesTest extends CiviEndToEndTestCase { /** - * @var Psr\SimpleCache\CacheInterface; + * @var Psr\SimpleCache\CacheInterface */ protected $a; /** - * @var Psr\SimpleCache\CacheInterface; + * @var Psr\SimpleCache\CacheInterface */ protected $b; diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 63a35cdef8..30c4e9e51b 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -25,7 +25,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { protected $_apiversion = 3; /** - * @var array e.g. $this->deletes['CRM_Contact_DAO_Contact'][] = $contactID; + * @var array + * e.g. $this->deletes['CRM_Contact_DAO_Contact'][] = $contactID; */ protected $deletableTestObjects; -- 2.25.1