X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FUtils%2FHookTest.php;h=6924840b6c74b13c61352eec008166f3d96d2ae8;hb=d111a110d99397070c6f3ee38c9f1525c30eb767;hp=afe8ed133374215aa336f7dfe5ffbfa87118eafc;hpb=674cb8b854f6008090d4dcce9372ee76346a198f;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index afe8ed1333..6924840b6c 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -1,29 +1,29 @@ fakeModules = array( + $this->fakeModules = [ 'hooktesta', 'hooktestb', 'hooktestc', 'hooktestd', 'hookteste', - ); + ]; // our goal is to test a helper in CRM_Utils_Hook, but we need a concrete class $this->hook = new CRM_Utils_Hook_UnitTests(); - $this->log = array(); + $this->log = []; self::$activeTest = $this; } @@ -39,14 +39,14 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { $arg1 = 'whatever'; $this->hook->runHooks($this->fakeModules, 'civicrm_testRunHooks_outer', 1, $arg1, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject); $this->assertEquals( - array( + [ 'a-outer', 'b-outer-1', 'a-inner', 'b-inner', 'b-outer-2', 'c-outer', - ), + ], $this->log ); } @@ -57,11 +57,11 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { public function testRunHooks_merge() { $result = $this->hook->runHooks($this->fakeModules, 'civicrm_testRunHooks_merge', 0, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject, CRM_Utils_Hook::$_nullObject); $this->assertEquals( - array( + [ 'from-module-a1', 'from-module-a2', 'from-module-e', - ), + ], $result ); } @@ -104,7 +104,7 @@ function hooktestb_civicrm_testRunHooks_inner() { * @return array */ function hooktesta_civicrm_testRunHooks_merge() { - return array('from-module-a1', 'from-module-a2'); + return ['from-module-a1', 'from-module-a2']; } // OMIT: function hooktestb_civicrm_testRunHooks_merge @@ -113,7 +113,7 @@ function hooktesta_civicrm_testRunHooks_merge() { * Implements hook_civicrm_testRunHooks_merge(). */ function hooktestc_civicrm_testRunHooks_merge() { - return array(); + return []; } /** @@ -127,5 +127,5 @@ function hooktestd_civicrm_testRunHooks_merge() { * @return array */ function hookteste_civicrm_testRunHooks_merge() { - return array('from-module-e'); + return ['from-module-e']; }