* Set up participant requirements for test.
*/
public function _setUpPledgeObjects() {
- $this->_pledgeId = $this->pledgeCreate($this->_contactId);
+ $this->_pledgeId = $this->pledgeCreate(array('contact_id' => $this->_contactId));
//we'll create membership payment here because to make setup more re-usable
$pledgePayment = $this->callAPISuccess('pledge_payment', 'create', array(
'version' => 3,
}
/**
- * Create contribution.
+ * Create pledge.
*
- * @param int $cID
- * Contact_id.
+ * @param array $params
+ * Parameters.
*
* @return int
- * id of created contribution
+ * id of created pledge
*/
- public function pledgeCreate($cID) {
- $params = array(
- 'contact_id' => $cID,
+ public function pledgeCreate($params) {
+ $params = array_merge(array(
'pledge_create_date' => date('Ymd'),
'start_date' => date('Ymd'),
'scheduled_date' => date('Ymd'),
'frequency_unit' => 'year',
'frequency_day' => 15,
'installments' => 5,
- );
+ ),
+ $params);
$result = $this->callAPISuccess('Pledge', 'create', $params);
return $result['id'];
public function setUp() {
parent::setUp();
$this->_individualId = $this->individualCreate();
- $this->_pledgeID = $this->pledgeCreate($this->_individualId);
+ $this->_pledgeID = $this->pledgeCreate(array('contact_id' => $this->_individualId));
$this->_contributionID = $this->contributionCreate(array('contact_id' => $this->_individualId));
}
*/
public function testCreateUpdatePledge() {
// we test 'sequential' param here too
- $pledgeID = $this->pledgeCreate($this->_individualId);
+ $pledgeID = $this->pledgeCreate(array('contact_id' => $this->_individualId));
$old_params = array(
'id' => $pledgeID,
'sequential' => 1,
* We test 'sequential' param here too.
*/
public function testCreateUpdatePledgeLegacy() {
- $pledgeID = $this->pledgeCreate($this->_individualId);
+ $pledgeID = $this->pledgeCreate(array('contact_id' => $this->_individualId));
$old_params = array(
'id' => $pledgeID,
'sequential' => 1,
*/
public function testDeletePledge() {
- $pledgeID = $this->pledgeCreate($this->_individualId);
+ $pledgeID = $this->pledgeCreate(array('contact_id' => $this->_individualId));
$params = array(
'pledge_id' => $pledgeID,
);
- $result = $this->callAPIAndDocument('pledge', 'delete', $params, __FUNCTION__, __FILE__);
+ $this->callAPIAndDocument('pledge', 'delete', $params, __FUNCTION__, __FILE__);
}
/**
*/
public function testDeletePledgeUseID() {
- $pledgeID = $this->pledgeCreate($this->_individualId);
+ $pledgeID = $this->pledgeCreate(array('contact_id' => $this->_individualId));
$params = array(
'id' => $pledgeID,
);