projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove use of ignoreException() from SMTP settings form.
[civicrm-core.git]
/
Civi
/
Test
/
Api3TestTrait.php
diff --git
a/Civi/Test/Api3TestTrait.php
b/Civi/Test/Api3TestTrait.php
index ed3557babe9622f3f507d4d54f38c29cd6f20531..5be0bc9ae3270511e6872ec18e06dc6309f3b882 100644
(file)
--- a/
Civi/Test/Api3TestTrait.php
+++ b/
Civi/Test/Api3TestTrait.php
@@
-173,7
+173,7
@@
trait Api3TestTrait {
/**
* This function exists to wrap api getValue function & check the result
/**
* This function exists to wrap api getValue function & check the result
- * so we can ensure they succeed & throw exceptions without litter
er
ing the test with checks
+ * so we can ensure they succeed & throw exceptions without littering the test with checks
* There is a type check in this
*
* @param string $entity
* There is a type check in this
*
* @param string $entity
@@
-260,7
+260,6
@@
trait Api3TestTrait {
public function callAPISuccessGetValue($entity, $params, $type = NULL) {
$params += [
'version' => $this->_apiversion,
public function callAPISuccessGetValue($entity, $params, $type = NULL) {
$params += [
'version' => $this->_apiversion,
- 'debug' => 1,
];
$result = $this->civicrm_api($entity, 'getvalue', $params);
if (is_array($result) && (!empty($result['is_error']) || isset($result['values']))) {
];
$result = $this->civicrm_api($entity, 'getvalue', $params);
if (is_array($result) && (!empty($result['is_error']) || isset($result['values']))) {
@@
-405,6
+404,9
@@
trait Api3TestTrait {
$v3Params['option_group.name'] = $v3Params['option_group_id'];
unset($v3Params['option_group_id']);
}
$v3Params['option_group.name'] = $v3Params['option_group_id'];
unset($v3Params['option_group_id']);
}
+ if (isset($field['pseudoconstant'], $v3Params[$name]) && $field['type'] === \CRM_Utils_Type::T_INT && !is_numeric($v3Params[$name])) {
+ $v3Params[$name] = \CRM_Core_PseudoConstant::getKey(\CRM_Core_DAO_AllCoreTables::getFullName($v3Entity), $name, $v3Params[$name]);
+ }
}
switch ($v3Action) {
}
switch ($v3Action) {
@@
-423,10
+425,9
@@
trait Api3TestTrait {
$v4Params['select'][] = 'id';
}
// Convert join syntax
$v4Params['select'][] = 'id';
}
// Convert join syntax
- foreach ($v4Params['select'] as
&
$select) {
+ foreach ($v4Params['select'] as
$idx =>
$select) {
if (strstr($select, '_id.')) {
if (strstr($select, '_id.')) {
- $joins[$select] = explode('.', str_replace('_id.', '.', $select));
- $select = str_replace('_id.', '.', $select);
+ $joins[$select] = $v4Params['select'][$idx] = str_replace('_id.', '.', $select);
}
}
}
}
}
}
@@
-596,8
+597,8
@@
trait Api3TestTrait {
$result[$index][$key] = $this->runApi4LegacyChain($key, $params, $v4Entity, $row, $sequential);
}
// Convert join format
$result[$index][$key] = $this->runApi4LegacyChain($key, $params, $v4Entity, $row, $sequential);
}
// Convert join format
- foreach ($joins as $api3Key => $api4
Path
) {
- $result[$index][$api3Key] =
\CRM_Utils_Array::pathGet($result[$index], $api4Path)
;
+ foreach ($joins as $api3Key => $api4
Key
) {
+ $result[$index][$api3Key] =
$result[$index][$api4Key] ?? NULL
;
}
// Resolve custom field names
foreach ($custom as $group => $fields) {
}
// Resolve custom field names
foreach ($custom as $group => $fields) {