EntityTokens - Allow using mocked data
authorTim Otten <totten@civicrm.org>
Wed, 15 Sep 2021 09:46:46 +0000 (02:46 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 15 Sep 2021 20:12:29 +0000 (13:12 -0700)
commit595cc868bf0deb902254529a1afa6d4d7cee5dc4
treec0ebd66231d5de8c2ec54919f3fc55780072ee1b
parentc27d9bb676592d6c2fc466390e47615a1aa17f3f
EntityTokens - Allow using mocked data

Before: EntityTokens reads `$tokenContext['contributionId']` and fetches the corresponding `civicrm_contribution`. The
data must exist in that record.

After: EntityTokens reads both `$tokenContext['contributionId']` and `$tokenContext['contribution']`. Data in
`$tokenContext['contribution']` takes precedence, rendering the content of `civicrm_contribution` mute.
CRM/Core/EntityTokens.php
tests/phpunit/Civi/Token/TokenProcessorTest.php