protected $_apiversion = 3;
protected $test_activity_type_value;
protected $_contactID;
+ /**
+ * Activity type id created for use in this test class.
+ *
+ * @var int
+ */
+ protected $test_activity_type_id;
/**
* Test setup for every test.
* Check with incorrect required fields.
*/
public function testActivityCreateWithUnknownActivityTypeId() {
- $params = array(
+ $this->callAPIFailure('activity', 'create', [
'source_contact_id' => $this->_contactID,
'subject' => 'Make-it-Happen Meeting',
'activity_date_time' => date('Ymd'),
'details' => 'a test activity',
'status_id' => 1,
'activity_type_id' => 699,
- );
-
- $result = $this->callAPIFailure('activity', 'create', $params);
+ ]);
}
public function testActivityCreateWithInvalidPriority() {
$this->assertEquals($result['values'][0]['id'], $result['id']);
}
- /**
- * Check activity deletion with empty params.
- */
- public function testDeleteActivityForEmptyParams() {
- $params = array('version' => $this->_apiversion);
- $this->callAPIFailure('activity', 'delete', $params);
- }
-
/**
* Check activity deletion without activity id.
*/
public function testDeleteActivityWithoutId() {
- $params = array(
- 'activity_name' => 'Meeting',
- 'version' => $this->_apiversion,
- );
- $result = $this->callAPIFailure('activity', 'delete', $params);
+ $this->callAPIFailure('activity', 'delete', ['activity_name' => 'Meeting'], 'Mandatory key(s) missing from params array: id');
}
/**
* Check activity deletion without activity type.
*/
- public function testDeleteActivityWithoutActivityType() {
- $params = array('id' => 1);
- $result = $this->callAPIFailure('activity', 'delete', $params);
- }
-
- /**
- * Check activity deletion with incorrect data.
- */
- public function testDeleteActivityWithIncorrectActivityType() {
- $params = array(
- 'id' => 1,
- 'activity_name' => 'Test Activity',
- );
-
- $result = $this->callAPIFailure('activity', 'delete', $params);
+ public function testDeleteActivityWithInvalidID() {
+ $this->callAPIFailure('activity', 'delete', ['id' => 1], 'Could not delete Activity: 1');
}
/**
*/
public function testDeleteActivity() {
$result = $this->callAPISuccess('activity', 'create', $this->_params);
- $params = array(
- 'id' => $result['id'],
- 'version' => $this->_apiversion,
- );
-
+ $params = ['id' => $result['id']];
$this->callAPIAndDocument('activity', 'delete', $params, __FUNCTION__, __FILE__);
}
* Check if required fields are not passed.
*/
public function testActivityUpdateWithoutRequired() {
- $params = array(
+ $this->callAPIFailure('activity', 'create', [
'subject' => 'this case should fail',
'scheduled_date_time' => date('Ymd'),
- );
-
- $result = $this->callAPIFailure('activity', 'create', $params);
+ ]);
}
/**