Skip to content
Snippets Groups Projects
Commit e9779134 authored by Tim Otten's avatar Tim Otten
Browse files

Merge pull request #938 from totten/master-restore-api_v3

api_v3_AllTests - Misc
parents e156d1cf 0fbbde94
No related branches found
No related tags found
No related merge requests found
......@@ -1723,7 +1723,7 @@ class CRM_Contact_BAO_Query {
$this->_qill[$grouping][] = ts('State') . " ($lType) $op '$value'";
}
}
elseif ($field['pseudoconstant']) {
elseif (!empty($field['pseudoconstant'])) {
$this->optionValueQuery(
$name, $op, $value, $grouping,
CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', $field['name']),
......
......@@ -1325,6 +1325,9 @@ SELECT contact_id
}
$constant = CRM_Utils_Array::value('pseudoconstant', $value);
if (!empty($constant)) {
if (empty($constant['name'])) {
throw new CRM_Core_Exception("Failed to choose value for $daoName ($name) -- missing pseudo-constant name");
}
$constantValues = CRM_Utils_PseudoConstant::getConstant($constant['name']);
if (!empty($constantValues)) {
$constantOptions = array_keys($constantValues);
......
......@@ -58,7 +58,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
* @see CiviUnitTestCase::tearDown()
*/
function tearDown() {
$this->hookClass->reset();
CRM_Utils_Hook::singleton()->reset();
$tablesToTruncate = array(
'civicrm_contact',
);
......
......@@ -130,6 +130,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
'version' => $this->_apiversion,
);
$result = civicrm_api('constant', 'get', $params);
$this->assertAPISuccess($result);
$this->documentMe($params, $result, __FUNCTION__, __FILE__);
$this->assertTrue($result['count'] > 3, "In line " . __LINE__);
$this->assertContains('Home', $result['values'], "In line " . __LINE__);
......@@ -150,6 +151,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
'name' => 'phoneType',
'version' => $this->_apiversion,
));
$this->assertAPISuccess($result);
$this->assertEquals(5, $result['count'], "In line " . __LINE__);
$this->assertContains('Phone', $result['values'], "In line " . __LINE__);
......@@ -175,6 +177,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
'name' => 'mailProtocol',
'version' => $this->_apiversion,
));
$this->assertAPISuccess($result);
$this->assertEquals(4, $result['count'], "In line " . __LINE__);
$this->assertContains('IMAP', $result['values'], "In line " . __LINE__);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment