Skip to content

Commit

Permalink
Minor test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jul 30, 2022
1 parent 748db28 commit f740d86
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 146 deletions.
2 changes: 1 addition & 1 deletion CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function setDefaultValues() {
$unsetSubmittedOptions[$val['id']] = $optionFullIds;
}
//reset values for all options those are full.
CRM_Event_Form_Registration::resetElementValue($unsetSubmittedOptions, $this);
CRM_Event_Form_Registration::resetElementValue($unsetSubmittedOptions ?? [], $this);
}

//set default participant fields, CRM-4320.
Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ public function testDashboardContentContributions(): void {
* @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,
Expand Down Expand Up @@ -205,7 +205,7 @@ protected function runUserDashboard(): void {
/**
* 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',
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ public function testEventTypeRegistrationDate(): void {
$actionSchedule['start_action_offset'] = 7;
$actionSchedule['start_action_unit'] = 'day';
$actionSchedule['start_action_date'] = 'registration_end_date';
$actionSchedule['entity_value'] = $event['values'][$event['id']]['event_type_id'];
$actionSchedule['entity_value'] = $event['event_type_id'];
$actionSchedule['entity_status'] = $this->callAPISuccessGetValue('ParticipantStatusType', [
'return' => 'id',
'name' => 'Attended',
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Core/CopyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class CRM_Core_CopyTest extends CiviUnitTestCase {
public function testEventCopy(): void {

$this->createCustomGroupWithFieldOfType(['extends' => 'Event']);
$event = $this->eventCreate([$this->getCustomFieldName('text') => 'blah']);
$event = $this->eventCreate([$this->getCustomFieldName('text', 4) => 'blah']);
$eventId = $event['id'];
$eventRes = $event['values'][$eventId];
$eventRes = $event;
$params[$this->getCustomFieldName('text') . '_1'] = 'blah';
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
$eventId,
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Event/Form/ParticipantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function testSubmitUnpaidPriceChangeWhileStillPending() {
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
public function testPaymentAllocationOnMultiLineItemEvent() {
public function testPaymentAllocationOnMultiLineItemEvent(): void {
// USE-CASE :
// 1. Create a Price set with two price fields
// 2. Register for a Event using both the price field A($55 - qty 1) and B($10 - qty 1)
Expand Down
Loading

0 comments on commit f740d86

Please sign in to comment.