dev/core#2650 Add support for names & labels for token pseudoconstants
This is per https://lab.civicrm.org/dev/core/-/issues/2650 -
it
- ensures that the 4 existing functions that deal with tokens handle tokens for the
name and label for the (only) field that has had this treatment so far -contribution_status_id
Hence both CRM_Core_SelecetValues::contributionTokens and CRM_Contribute_Tokens->tokenNames
are tested to ensure they both return the same keys and labels for
{contribution.contribution_status_id}
{contribution.contribution_status_id:name}
{contribution.contribution_status_id:label}
And both rendering CRM_Contribute_Tokens via scheduled reminders and
using CRM_Contribute_BAO_Contribution::replaceContributionTokens are tested to ensure
they render them the same.
In the context of this PR no existing tokens are altered or removed & there is
only addition. However, the next step would be to remove the following token
from {contribution.status}. Since there is no UI availability
of this token it is likely unused - but that step would entail an upgrade
script to remove it from the saved scheduled reminders.
With those parts in place it should be possible to reconcile the remaining tokens,
lock that parity in with tests and move on to exposing the contribution tokens
to message templates.
It would be nice to fully remove CRM_Contribute_BAO_Contribution::replaceContributionTokens
or make it a wrapper for - however, I fear that might be quite
challenging due to the way it's used with group bys & some pretty intense hackery.