Skip to content

Commit

Permalink
Merge pull request #22128 from eileenmcnaughton/cus
Browse files Browse the repository at this point in the history
Ensure buildForm is called to assign values
  • Loading branch information
seamuslee001 authored Nov 24, 2021
2 parents b98ee14 + ea9a7ba commit 786b1f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/phpunit/CRM/Case/Form/CustomDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private function convertCurrency(string $input): string {
* Test that when custom case data is edited but not changed that it doesn't
* create a meaningless empty activity.
*/
public function testCustomDataNoChangeNoActivity() {
public function testCustomDataNoChangeNoActivity(): void {
// Create a custom group and field
$customField = $this->callAPISuccess('custom_field', 'create', [
'custom_group_id' => $this->custom_group['id'],
Expand Down Expand Up @@ -362,6 +362,7 @@ public function testCustomDataNoChangeNoActivity() {
// this is case type
$form->set('subType', 1);
$form->set('cid', $individual);
$form->buildForm();
ob_start();
$form->controller->_actions['display']->perform($form, 'display');
ob_end_clean();
Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit/CRM/Custom/Form/OptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CRM_Custom_Form_OptionTest extends CiviUnitTestCase {
/**
* Test the `name` field doesn't get changed when editing an existing option.
*/
public function testEditCustomFieldOptionValue() {
public function testEditCustomFieldOptionValue(): void {
// Create a custom field for contacts with some option choices
$customGroup = $this->customGroupCreate(['extends' => 'Contact', 'title' => 'contact stuff']);
$customField = $this->customFieldOptionValueCreate($customGroup, 'myCustomField');
Expand All @@ -28,6 +28,7 @@ public function testEditCustomFieldOptionValue() {
$form->set('id', $optionValue['id']);
$form->set('fid', $customField['id']);
$form->set('gid', $customGroup['id']);
$form->buildForm();

ob_start();
$form->controller->_actions['display']->perform($form, 'display');
Expand Down

0 comments on commit 786b1f3

Please sign in to comment.