From fb310e7b6db4a56b891c62545a163ff70585d05f Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Fri, 14 Feb 2020 21:28:46 -0500 Subject: [PATCH] remove unused code causing E_WARNING --- templates/CRM/Tag/Form/Edit.tpl | 9 ------- tests/phpunit/CRM/Core/FormTest.php | 38 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 tests/phpunit/CRM/Core/FormTest.php diff --git a/templates/CRM/Tag/Form/Edit.tpl b/templates/CRM/Tag/Form/Edit.tpl index 70829c1100..16c1032b4a 100644 --- a/templates/CRM/Tag/Form/Edit.tpl +++ b/templates/CRM/Tag/Form/Edit.tpl @@ -57,15 +57,6 @@ {/if} - {if $parent_tags|@count > 0} - - - {foreach from=$parent_tags item=ctag key=tag_id} - {assign var="element_name" value="remove_parent_tag_"|cat:$tag_id} - - {/foreach} -
  {$form.$element_name.html} {$form.$element_name.label}

- {/if} {else}
{ts 1=$delName}Are you sure you want to delete %1?{/ts}
{ts}This tag will be removed from any currently tagged contacts, and users will no longer be able to assign contacts to this tag.{/ts}
{/if} diff --git a/tests/phpunit/CRM/Core/FormTest.php b/tests/phpunit/CRM/Core/FormTest.php new file mode 100644 index 0000000000..39dc9fa13c --- /dev/null +++ b/tests/phpunit/CRM/Core/FormTest.php @@ -0,0 +1,38 @@ +getFormObject($classname); + $form->preProcess(); + $form->buildQuickForm(); + $form->setDefaultValues(); + $form->assign('action', CRM_Core_Action::UPDATE); + $form->getTemplate()->fetch($form->getTemplateFileName()); + } + + /** + * Dataprovider for testOpeningForms(). + * TODO: Add more forms! Use a descriptive array key so when it fails + * it will make it clearer what form it is, although you'll see the class + * anyway. + */ + public function formClassList() { + return [ + 'Add New Tag' => ['CRM_Tag_Form_Edit'], + ]; + } + +} -- 2.25.1