'weight', //won't update as there is no 1 in the same price set
),
),
+ 'SavedSearch' => array(
+ // I think the fields below are generated based on form_values.
+ 'cant_update' => array(
+ 'search_custom_id',
+ 'where_clause',
+ 'select_tables',
+ 'where_tables',
+ ),
+ ),
);
if (empty($knownFailures[$entity]) || empty($knownFailures[$entity][$key])) {
return array();
*/
public function testNotImplemented_get($Entity) {
$result = civicrm_api($Entity, 'Get', array('version' => 3));
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
// $this->assertContains("API ($Entity, Get) does not exist", $result['error_message']);
$this->assertRegExp('/API (.*) does not exist/', $result['error_message']);
}
return;
}
$result = civicrm_api($Entity, 'Get', array());
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertContains("Mandatory key(s) missing from params array", $result['error_message']);
}
*/
public function testNotImplemented_create($Entity) {
$result = civicrm_api($Entity, 'Create', array('version' => 3));
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertContains(strtolower("API ($Entity, Create) does not exist"), strtolower($result['error_message']));
}
*/
public function testCreateWrongTypeParamTag_create() {
$result = civicrm_api("Tag", 'Create', 'this is not a string');
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertEquals("Input variable `params` is not an array", $result['error_message']);
}
break;
case CRM_Utils_Type::T_TIMESTAMP:
- // 4.6 doesn't support timestamp updates from 4.7 we should uncomment this. See CRM-16431.
- continue;
-
- //case CRM_Utils_Type::T_DATETIME:
-
case 12:
$entity[$fieldName] = '2012-05-20 03:05:20';
break;
case CRM_Utils_Type::T_TEXT:
case CRM_Utils_Type::T_LONGTEXT:
case CRM_Utils_Type::T_EMAIL:
- $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
+ if ($fieldName == 'form_values' && $entity_name == 'SavedSearch') {
+ // This is a hack for the SavedSearch API. It expects form_values
+ // to be a serialized array.
+ // If you want to fix this, you should definitely read this forum
+ // post.
+ // http://forum.civicrm.org/index.php/topic,33990.0.html
+ // See also my question on the CiviCRM Stack Exchange:
+ // https://civicrm.stackexchange.com/questions/3437
+ $entity[$fieldName] = array('sort_name' => "SortName2");
+ }
+ else {
+ $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
+ }
break;
case CRM_Utils_Type::T_INT:
public function testNotImplemented_delete($Entity) {
$nonExistantID = 151416349;
$result = civicrm_api($Entity, 'Delete', array('version' => 3, 'id' => $nonExistantID));
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertContains(strtolower("API ($Entity, Delete) does not exist"), strtolower($result['error_message']));
}
return;
}
$result = civicrm_api($Entity, 'Delete', array());
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertContains("Mandatory key(s) missing from params array", $result['error_message']);
}
*/
public function testDeleteWrongTypeParamTag_delete() {
$result = civicrm_api("Tag", 'Delete', 'this is not a string');
- $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
+ $this->assertEquals(1, $result['is_error']);
$this->assertEquals("Input variable `params` is not an array", $result['error_message']);
}