projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #13854 from eileenmcnaughton/lock
[civicrm-core.git]
/
Civi
/
Test
/
CiviTestListener.php
diff --git
a/Civi/Test/CiviTestListener.php
b/Civi/Test/CiviTestListener.php
index d923fad9c9883648fda8a26194ba19693e3b6897..8eca8cbf756a478ac4aff5f9c58e140ba03a93d3 100644
(file)
--- a/
Civi/Test/CiviTestListener.php
+++ b/
Civi/Test/CiviTestListener.php
@@
-25,7
+25,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
* Ex: $cache['Some_Test_Class']['civicrm_foobar'] = 'hook_civicrm_foobar';
* Array(string $testClass => Array(string $hookName => string $methodName)).
*/
* Ex: $cache['Some_Test_Class']['civicrm_foobar'] = 'hook_civicrm_foobar';
* Array(string $testClass => Array(string $hookName => string $methodName)).
*/
- private $cache =
array()
;
+ private $cache =
[]
;
/**
* @var \CRM_Core_Transaction|NULL
/**
* @var \CRM_Core_Transaction|NULL
@@
-39,7
+39,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
}
public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) {
}
public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) {
- $this->cache =
array()
;
+ $this->cache =
[]
;
}
public function startTest(\PHPUnit_Framework_Test $test) {
}
public function startTest(\PHPUnit_Framework_Test $test) {
@@
-113,7
+113,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
protected function findTestHooks(HookInterface $test) {
$class = get_class($test);
if (!isset($this->cache[$class])) {
protected function findTestHooks(HookInterface $test) {
$class = get_class($test);
if (!isset($this->cache[$class])) {
- $funcs =
array()
;
+ $funcs =
[]
;
foreach (get_class_methods($class) as $func) {
if (preg_match('/^hook_/', $func)) {
$funcs[substr($func, 5)] = $func;
foreach (get_class_methods($class) as $func) {
if (preg_match('/^hook_/', $func)) {
$funcs[substr($func, 5)] = $func;
@@
-147,7
+147,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
/** @var \CRM_Utils_Hook_UnitTests $hooks */
$hooks = \CRM_Utils_Hook::singleton();
foreach ($this->findTestHooks($test) as $hook => $func) {
/** @var \CRM_Utils_Hook_UnitTests $hooks */
$hooks = \CRM_Utils_Hook::singleton();
foreach ($this->findTestHooks($test) as $hook => $func) {
- $hooks->setHook($hook,
array($test, $func)
);
+ $hooks->setHook($hook,
[$test, $func]
);
}
}
}
}
@@
-176,8
+176,8
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
}
$blurb = "Tip: Run the headless tests and end-to-end tests separately, e.g.\n"
}
$blurb = "Tip: Run the headless tests and end-to-end tests separately, e.g.\n"
- . " $ phpunit
4
--group headless\n"
- . " $ phpunit
4
--group e2e \n";
+ . " $ phpunit
5
--group headless\n"
+ . " $ phpunit
5
--group e2e \n";
if (!empty($byInterface['HeadlessInterface']) && CIVICRM_UF !== 'UnitTests') {
$testNames = implode(', ', array_keys($byInterface['HeadlessInterface']));
if (!empty($byInterface['HeadlessInterface']) && CIVICRM_UF !== 'UnitTests') {
$testNames = implode(', ', array_keys($byInterface['HeadlessInterface']));
@@
-208,7
+208,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
*/
protected function cv($cmd, $decode = 'json') {
$cmd = 'cv ' . $cmd;
*/
protected function cv($cmd, $decode = 'json') {
$cmd = 'cv ' . $cmd;
- $descriptorSpec =
array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => STDERR)
;
+ $descriptorSpec =
[0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => STDERR]
;
$oldOutput = getenv('CV_OUTPUT');
putenv("CV_OUTPUT=json");
$process = proc_open($cmd, $descriptorSpec, $pipes, __DIR__);
$oldOutput = getenv('CV_OUTPUT');
putenv("CV_OUTPUT=json");
$process = proc_open($cmd, $descriptorSpec, $pipes, __DIR__);
@@
-243,7
+243,7
@@
class CiviTestListener extends \PHPUnit_Framework_BaseTestListener {
* @return array
*/
protected function indexTestsByInterface($tests) {
* @return array
*/
protected function indexTestsByInterface($tests) {
- $byInterface =
array('HeadlessInterface' => array(), 'EndToEndInterface' => array())
;
+ $byInterface =
['HeadlessInterface' => [], 'EndToEndInterface' => []]
;
foreach ($tests as $test) {
/** @var \PHPUnit_Framework_Test $test */
if ($test instanceof HeadlessInterface) {
foreach ($tests as $test) {
/** @var \PHPUnit_Framework_Test $test */
if ($test instanceof HeadlessInterface) {