[REF] Extract getFromValues, add test
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 19 Sep 2021 10:44:20 +0000 (22:44 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 21 Sep 2021 06:52:02 +0000 (18:52 +1200)
commit2d7aca209608a3de817d7afe9f5942ffde36d04e
treee8075650e00796cdfeb96c37afe272dc57e02b4d
parentb3e1d54c7014db6096ca32888728cf9427df9731
[REF] Extract getFromValues, add test

This extracts the code used to get the from values, moves the default setting
to the default and adds a test.

The goal is actually to add a test on the submit function
but it's proving to be challenging so this at least gets the
default setting tested.

Note that this code used to be on a static class, not a trait, and
some stuff is in weird places - in particular stuff that
should be in setDefaults and postProcess is happening on
preProcess. However, most
of the classes that override this
trait do not do much more than call the trait so that helps at
least
CRM/Contact/Form/Task/EmailTrait.php
tests/phpunit/CRM/Contribute/Form/Task/EmailTest.php [new file with mode: 0644]