/**
* Test the content of the dashboard.
*
- * @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
- public function testDashboardContentContributions() {
+ public function testDashboardContentContributions(): void {
$this->contributionCreate(['contact_id' => $this->contactID]);
$this->contributions[] = civicrm_api3('Contribution', 'get', [
'contact_id' => $this->contactID,
$expectedStrings = [
'Your Contribution(s)',
'<table class="selector"><tr class="columnheader"><th>Total Amount</th><th>Financial Type</th><th>Received date</th><th>Receipt Sent</th><th>Balance</th><th>Status</th>',
- '<td>$ 100.00 </td><td>Donation</td>',
+ '<td>$100.00 </td><td>Donation</td>',
'<td>Completed</td>',
];
$this->assertPageContains($expectedStrings);
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
- public function testDashboardPartialPayments() {
+ public function testDashboardPartialPayments(): void {
$contributionId = $this->contributionCreate([
'contact_id' => $this->contactID,
'contribution_status_id' => 'Pending',
'total_amount' => 25,
]);
- $result = civicrm_api3('Payment', 'create', [
+ $this->callAPISuccess('Payment', 'create', [
'contribution_id' => $contributionId,
'total_amount' => 11,
- 'trxn_date' => "2021-05-11",
+ 'trxn_date' => '2021-05-11',
]);
$this->contributions[] = civicrm_api3('Contribution', 'get', [
'contact_id' => $this->contactID,
$expectedStrings = [
'Your Contribution(s)',
'<table class="selector"><tr class="columnheader"><th>Total Amount</th><th>Financial Type</th><th>Received date</th><th>Receipt Sent</th><th>Balance</th><th>Status</th>',
- '<td>$ 25.00 </td><td>Donation</td>',
- '<td>$ 14.00</td><td>Partially paid</td>',
+ '<td>$25.00 </td><td>Donation</td>',
+ '<td>$14.00</td><td>Partially paid</td>',
'Pay Now',
];
$this->assertPageContains($expectedStrings);
/**
* Tests the event dashboard as a minimally permissioned user.
*/
- public function testEventDashboard() {
+ public function testEventDashboard(): void {
CRM_Core_Config::singleton()->userPermissionClass->permissions = [
'register for events',
'access Contact Dashboard',