(REF) Civi\Test - Use de-minimis ts() while runnning installation
authorTim Otten <totten@civicrm.org>
Mon, 27 Jan 2020 23:50:52 +0000 (15:50 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 28 Jan 2020 22:20:46 +0000 (14:20 -0800)
commit9d114ab61c840acd8257734ff766582f4bb6d05e
treebef1f909ffea81ccc8bb77aa8d302541cbb9f839
parent50b8ea3e511f1a35c37084133adf8c14c185baa4
(REF) Civi\Test - Use de-minimis ts() while runnning installation

When running early-stage installation helpers like
`Civi\Test::headless()->...->apply()` or `Civi\Test:data()->...->populate()`
it can be hard to call `CRM_CodeGen_*` functionality - because that relies
on `ts()` which relies on other system services.

This change basically suspends/swaps some of the default `ts()` behavior
while the test system performs installation.

The change is in two sub-parts:

* Implement `asPreInstall()` (Files: `Civi/Test.php` and `CRM/Core/I18n.php`)
    * Add the helper `\Civi\Test::asPreInstall()`
    * Skip the use of "word replacements" during the pre-install phase
* Use `asPreInstall()` (Files: `Civi/Test/Data.php` and `Civi/Test/CiviEnvBuilder.php`)
    * Wrap existing code with the helper `\Civi\Test::asPreInstall(). These changes look big, but that's
      just whitespace -- inserting `asPreInstall()` changes the indentation.

This lays groundwork for another commit which will replace some references to `sql/civicrm*.mysql`
with references to `CRM_CodeGen_*`.
CRM/Core/I18n.php
Civi/Test.php
Civi/Test/CiviEnvBuilder.php
Civi/Test/Data.php