$defaults = array();
$paymentid = CRM_Pledge_BAO_PledgePayment::retrieve($params, $defaults);
- $this->assertEquals(count($paymentid), 0, "Pledge Id must be greater than 0");
+ $this->assertEquals(is_null($paymentid), 1, "Pledge Id must be greater than 0");
$result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id);
}
$defaults = array();
$paymentid = CRM_Pledge_BAO_PledgePayment::retrieve($params, $defaults);
- $this->assertEquals(count($paymentid), 0, "Pledge Id cannot be a string");
+ $this->assertEquals(is_null($paymentid), 1, "Pledge Id cannot be a string");
$result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id);
}
$defaults = array();
$paymentid = CRM_Pledge_BAO_PledgePayment::retrieve($params, $defaults);
- $this->assertEquals(count($paymentid), 1, "Pledge was retrieved");
+ $this->assertEquals($paymentid->N, 1, "Pledge was retrieved");
$result = CRM_Pledge_BAO_Pledge::deletePledge($pledgeId);
}
public function testDeletePledgePaymentsNormal() {
$payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment');
$paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments($payment->pledge_id);
- $this->assertEquals(count($paymentid), 1, "Deleted one payment");
+
+ $this->assertEquals($paymentid, 1, "Deleted one payment");
$result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id);
}
public function testDeletePledgePaymentsNullId() {
$payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment');
$paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments(NULL);
- $this->assertEquals(count($paymentid), 1, "No payments deleted");
+ $this->assertFalse($paymentid, "No payments deleted");
$result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id);
}
$params = array('pledge_id' => 0);
$pledgeId = CRM_Pledge_BAO_Pledge::retrieve($params, $defaults);
- $this->assertEquals(count($pledgeId), 0, "Pledge Id must be greater than 0");
+ $this->assertEquals(is_null($pledgeId), 1, "Pledge Id must be greater than 0");
}
/**
$params = array('pledge_id' => 'random text');
$pledgeId = CRM_Pledge_BAO_Pledge::retrieve($params, $defaults);
- $this->assertEquals(count($pledgeId), 0, "Pledge Id must be a string");
+ $this->assertEquals(is_null($pledgeId), 1, "Pledge Id must be a string");
}
/**
$pledgeId = CRM_Pledge_BAO_Pledge::retrieve($pledgeParams, $defaults);
- $this->assertEquals(count($pledgeId), 1, "Pledge was retrieved");
+ $this->assertEquals($pledgeId->N, 1, "Pledge was retrieved");
}
/**